» Python urllib2 throwing exceptions with
Python urllib2 throwing exceptions with
|April 4, 2013
Posted by forumadmin
I have a python web-scraper script that has been running fine for months. It uses urllib2 to access remote URLs, submit data, capture results, etc.
Suddenly yesterday urlli2 started throwing errors on most (but not all) attempts to access the remote URLs. The error is:
URLError: urlopen error [Errno -2] Name or service not known
What could cause 90% of remote requests to suddenly fail? What does
[Errno -2] actually mean??
I have searched the
urllib2 docs but found no real explanation of
[Errno -2], also have searched here for any answers without success.
More Related Questions
- Amazon SNS with Python Trying to get started with Amazon SNS. API is very simple REST. I seem to be hung up on the signature part of the call. The API example […]
- My Python script doesnt give me an error or shows any output I'm creating a simple transit twitter-bot which posts a tweet to my API, then grabs the result to later on reply with an answer on travel times and such. All the magic is on the […]
- python ssl eof occurred in violation of protocol, wantwriteerror, zeroreturnerror I'm running many celery tasks (20,000) using gevent for the pool (also monkey patching all). Each of these tasks hit 3rd party services like adwords to pull data.
I keep having tasks fail […]
- Using MultipartPostHandler to POST form-data with Python Problem: When POSTing data with Python's urllib2, all data is URL encoded and sent as Content-Type: application/x-www-form-urlencoded. When uploading files, the Content-Type should […]
- Combine Range and Accept-Encoding HTTP headers I am coding a program that should scrape a large number of pages from one server to collect data for an academic research project. I am using Python + urllib2 to do that. The HTML pages I […]
- Python – urllib2 how to know if our authorization is successful When you would normally login to a website we can use urllib2.Request as so.
import urllib2, base64
req = urllib2.Request("http://www.facebook.com/")
base64string = […]
- Check the server response code, then export to csv I'm using the below code to check server response codes. Instead of manually entering the URLs, i'd like python to check a CSV (data.csv) and then export the results to a new CSV […]
- How to get the url from the request I am building a blog and I am working on a way to export it's contents to json and xml. To get this working, I thought of getting the url of the page whose content I wanted to export from […]
- How to speed up web crawling in Python? I'm using urllib.urlopen() method and BeautfulSoup for crawling. I am not satisfied with browsing speed, and I'm thinking about what urllib is parsing, guessing it got to load more than […]
- How do you access an authenticated Google App Engine service from a (non-web) python client? I have a Google App Engine app - http://mylovelyapp.appspot.com/
It has a page - mylovelypage
For the moment, the page just does self.response.out.write('OK')
If I run the following […]