本文整理汇总了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))