本文整理匯總了Python中urllib.robotparser方法的典型用法代碼示例。如果您正苦於以下問題:Python urllib.robotparser方法的具體用法?Python urllib.robotparser怎麽用?Python urllib.robotparser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類urllib
的用法示例。
在下文中一共展示了urllib.robotparser方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_urllib_imports_moves
# 需要導入模塊: import urllib [as 別名]
# 或者: from urllib import robotparser [as 別名]
def test_urllib_imports_moves(self):
import future.moves.urllib
import future.moves.urllib.parse
import future.moves.urllib.request
import future.moves.urllib.robotparser
import future.moves.urllib.error
import future.moves.urllib.response
self.assertTrue(True)
示例2: test_urllib_imports_install_aliases
# 需要導入模塊: import urllib [as 別名]
# 或者: from urllib import robotparser [as 別名]
def test_urllib_imports_install_aliases(self):
with standard_library.suspend_hooks():
standard_library.install_aliases()
import urllib
import urllib.parse
import urllib.request
import urllib.robotparser
import urllib.error
import urllib.response
self.assertTrue(True)
示例3: test_urllib_imports_cm
# 需要導入模塊: import urllib [as 別名]
# 或者: from urllib import robotparser [as 別名]
def test_urllib_imports_cm(self):
with standard_library.hooks():
import urllib
import urllib.parse
import urllib.request
import urllib.robotparser
import urllib.error
import urllib.response
self.assertTrue(True)
示例4: test_urllib_imports_install_hooks
# 需要導入模塊: import urllib [as 別名]
# 或者: from urllib import robotparser [as 別名]
def test_urllib_imports_install_hooks(self):
standard_library.remove_hooks()
standard_library.install_hooks()
import urllib
import urllib.parse
import urllib.request
import urllib.robotparser
import urllib.error
import urllib.response
self.assertTrue(True)
示例5: test_install_aliases
# 需要導入模塊: import urllib [as 別名]
# 或者: from urllib import robotparser [as 別名]
def test_install_aliases(self):
"""
Does the install_aliases() interface monkey-patch urllib etc. successfully?
"""
from future.standard_library import remove_hooks, install_aliases
remove_hooks()
install_aliases()
from collections import Counter, OrderedDict # backported to Py2.6
from collections import UserDict, UserList, UserString
# Requires Python dbm support:
# import dbm
# import dbm.dumb
# import dbm.gnu
# import dbm.ndbm
from itertools import filterfalse, zip_longest
from subprocess import check_output # backported to Py2.6
from subprocess import getoutput, getstatusoutput
from sys import intern
# test_support may not be available (e.g. on Anaconda Py2.6):
# import test.support
import urllib.error
import urllib.parse
import urllib.request
import urllib.response
import urllib.robotparser
self.assertTrue('urlopen' in dir(urllib.request))