Forums

Connection refused in connecting to Parse

Hi,

I have a python script that connects to api.parse.com, but I'm getting a connection refused error. Here's my traceback:

Traceback (most recent call last):
  File "DiningParse.py", line 12, in <module>
    connection.connect()
  File "/usr/lib/python2.7/httplib.py", line 1172, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 111] Connection refused

2015-04-09 03:55:20 -- Completed task, took 10.00 seconds, return code was 1.

What's the problem? I have a free account but api.parse.com is on the free whitelist. Also, if a website is not on the whitelist, can I still open the page from a script to scrape it?

Thanks

From the traceback, it looks like you're using your own code to make the connection using httplib. A quick look through the httplib docs suggests that it doesn't have built-in proxy support. Since external connections for free accounts go through a proxy, you need to take that into account in your code. I would suggest using requests which should just read the environment variables that we use to configure proxy access.