How Do I Fix This Ioerror: [errno Socket Error] [errno 11004]?
This simple Python 3 script: import urllib.request host = 'scholar.google.com' link = '/scholar.bib?q=info:K7uZdMSvdQ0J:scholar.google.com/&output=citation&hl=en&as_sd
Solution 1:
Here's your problem:
urllib.request.urlretrieve("http://scholar.google.com" + url, filename)
You're adding the http://scholar.google.com
part twice (url
already starts http://scholar.google.com
). Therefore urillib
thinks you're asking for a page on scholar.google.comhttp
-- needless to say, this domain does not exist. Which is exactly what your error says.
Just request url
obviously.
Handy hint to find this kind of thing faster in the future: when adding a print
statement for debugging, be sure to print the actual value you are using in the command you're debugging. You would have found this in approximately two seconds if your print
statement had also concatenated the base URL.
Post a Comment for "How Do I Fix This Ioerror: [errno Socket Error] [errno 11004]?"