471,310 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Using urllib2 to get info from webpage

Thekid
145 100+
I'm trying to familiarize myself with urllib2 and what I want to try is to take a puzzle from a website, complete it and then submit it back to the website. So far this is what I have but I do have some ideas for other parts of it. For now I'm just working on getting the puzzle from the page. This will print out the entire page. BeautifulSoup and html5lib were suggested to me and I briefly looked at them but wanted to know if there's a simplier way of grabbing info from a site.

Expand|Select|Wrap|Line Numbers
  1. import urllib2
  2. req = urllib2.Request('http://www.cryptograms.org')
  3. response = urllib2.urlopen(req)
  4. the_page = response.read()
  5. print the_page
  6.  
Oct 26 '07 #1
0 1281

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Andre Bocchini | last post: by
reply views Thread by Lee, Dustin | last post: by
2 posts views Thread by John F Dutcher | last post: by
2 posts views Thread by Joshua Ginsberg | last post: by
11 posts views Thread by Johnny Lee | last post: by
1 post views Thread by onceuponapriori | last post: by
3 posts views Thread by Magnus.Moraberg | last post: by
1 post views Thread by Larry Hale | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.