Hello,
Great service! I've just signed up today and have a 'Hacker' paid account.
I am trying to automate a task to check a website to see if anything has changed.
It seems like, for whatever reason, when I try to access the website using either lxml or requests, PA is 'hanging' / timing out.
I tried a half dozen other sites and been able to get a response of some kind...see below
r = requests.get( "http://www.pythonanywhere.com/terms" )
print 'REQUESTS HTTP response code for the url ', 'python anywhere', ' => ', r.status_code
r = requests.get( "http://www.cnn.com" )
print 'REQUESTS HTTP response code for the url ', 'cnn', ' => ', r.status_code
page = requests.get( "http://www.politico.com" )
print 'REQUESTS HTTP response code for the url ', 'Politico', ' => ', page.status_code
page = requests.get( "http://www.reddit.com" )
print 'REQUESTS HTTP response code for the url ', 'Reddit', ' => ', page.status_code
page = requests.get( "http://www.ticketmaster.com" )
print 'REQUESTS HTTP response code for the url ', 'Ticket Master', ' => ', page.status_code
page = requests.get( "http://www.apeconcerts.com" )
print 'REQUESTS HTTP response code for the url ', 'APE Concerts', ' => ', page.status_code
results in...
01:15 ~ $ python ticktateScraperv02.py
Completed Yesterday Module
REQUESTS HTTP response code for the url python anywhere => 200
REQUESTS HTTP response code for the url cnn => 200
REQUESTS HTTP response code for the url Politico => 200
REQUESTS HTTP response code for the url Reddit => 200
REQUESTS HTTP response code for the url Ticket Master => 403
...and then nothing until I do a KeyboardInterrupt:
^CTraceback (most recent call last):
File "ticktateScraperv02.py", line 64, in <module>
page = requests.get( "http://www.apeconcerts.com" )
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 334, in send
timeout=timeout
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 480, in urlopen
body=body, headers=headers)
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 313, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1051, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 415, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
KeyboardInterrupt
The code works fine from my local machine, by the way.
Thoughts?
Thanks!
Sincerely, Michael