Advertisement
rfmonk

web_scraping.py

Jan 13th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import mechanize
  5.  
  6. # The URL to this service
  7. URL = 'http://www.cepstral.com/cgi-bin/demos/weather'
  8.  
  9.  
  10. def main():
  11.     b = mechanize.Browser()
  12.     b.open(URL)
  13.     b.select_form(nr=0)
  14.     b['city'] = 'San Francisco'
  15.     b['state'] = 'CA'
  16.     return b.submit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement