Skip to content

Instantly share code, notes, and snippets.

@offby1
Created January 3, 2016 00:18
Show Gist options
  • Save offby1/f7328afa903d70a2e803 to your computer and use it in GitHub Desktop.
Save offby1/f7328afa903d70a2e803 to your computer and use it in GitHub Desktop.
>>> import requests
>>> url = 'http://www.weatheraction.com/pages/pv.asp?p=wact46'
>>> url += "'"
>>> requests.get (url)
<Response [500]>
>>> response = requests.get (url)
>>> response.body
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Response' object has no attribute 'body'
>>> response.text
' <font face="Arial" size=2>\n<p>Provider</font> <font face="Arial" size=2>error \'80020005\'</font>\n<p>\n<font face="Arial" size=2>Type m\
ismatch.</font>\n<p>\n<font face="Arial" size=2>/pages/pv.asp</font><font face="Arial" size=2>, line 72</font> '
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment