无法在python中获取url
我无法从biblegateway.com获取url,此处显示错误为 urllib2.URLError:请不要重复,因为我浏览了重复显示的站点,但访问该站点时我不理解这些站点 这是我的密码无法在python中获取url,python,python-2.7,urllib2,Python,Python 2.7,Urllib2,我无法从biblegateway.com获取url,此处显示错误为 urllib2.URLError:请不要重复,因为我浏览了重复显示的站点,但访问该站点时我不理解这些站点 这是我的密码 import urllib2 url = 'https://www.biblegateway.com/passage/?search=Deuteronomy+1&version=NIV' response = urllib2.urlopen(url) html = response.read() pri
import urllib2
url = 'https://www.biblegateway.com/passage/?search=Deuteronomy+1&version=NIV'
response = urllib2.urlopen(url)
html = response.read()
print html
这里是一个很好的参考 在python 3中,您可以有:
from urllib.request import urlopen
URL = 'https://www.biblegateway.com/passage/?search=Deuteronomy+1&version=NIV'
f = urlopen(URL)
myfile = f.read()
print(myfile)
但不确定它是否清除了ssl问题。也许有一些线索。哪条python?与python 2.7@dave_thompson_085相比,我正在使用python 2.7@dave_thompson_085其显示的AttributeError的可能重复:“module”对象没有属性“request”@EvgenyAr是否在python 3中运行它?它现在通过在3.6中通过import urllib.request@Evgenyright重放import urllib工作。它是否绕过了ssl错误?而且,它比urllib更简单、更高级