Created
October 14, 2010 10:35
-
-
Save andresgutgon/625996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = 'http://www.example.com/form' | |
values = {'param1' : '3','param2' : '29'} | |
data = urllib.urlencode(values) | |
req = urllib2.Request(url) | |
req.add_data(data) | |
try: | |
html = urllib2.urlopen(req) | |
except HTTPError, e: | |
ss.invalid_links += 'HTTP Error ERROR en el listado code => %s \n URL=> %s\n' % (e.code,url) | |
except URLError, e: | |
ss.invalid_links += 'URL Error ERROR en el listado reason => %s \n URL=> %s\n' % (e.reason,url) | |
soup = BeautifulSoup(html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment