0

I was not able to fetch url from biblegateway.com here it shows error as urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure> Please don't make duplicate as i went throught the sites which shown in duplicate i didn't understand by visiting that site .

here is my code

import urllib2
url = 'https://www.biblegateway.com/passage/?search=Deuteronomy+1&version=NIV'
response = urllib2.urlopen(url)
html = response.read()
print html
3

1 Answer 1

1

Here is a good reference for fetching url.

In python 3 you can have:

from urllib.request import urlopen
URL = 'https://www.biblegateway.com/passage/?search=Deuteronomy+1&version=NIV'
f = urlopen(URL)
myfile = f.read()
print(myfile)

Not sure it clears a ssl problem though. Maybe some clues here.

Sign up to request clarification or add additional context in comments.

5 Comments

its showing AttributeError: 'module' object has no attribute 'request' @Evgeny
Are running it in python 3?
Its working now by replaing import urllib by import urllib.request @ Evgeny
right, in 3.6 it does. does it bypass ssl error though?
also, requests is a lot easier, more high level than urllib

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.