Skip to content

Instantly share code, notes, and snippets.

@andresgutgon
Created October 14, 2010 10:35
Show Gist options
  • Save andresgutgon/625996 to your computer and use it in GitHub Desktop.
Save andresgutgon/625996 to your computer and use it in GitHub Desktop.
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