pynav

Python programmatic web browser to fetch data and test web sites
Download

pynav Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • sloft
  • Publisher web site:
  • http://bitbucket.org/sloft/

pynav Tags


pynav Description

Python programmatic web browser to fetch data and test web sites pynav is a Python programmatic web browser to fetch data and test web sites.Bug reporting and features asking are welcome: http://bitbucket.org/sloft/pynav/issues/?status=new&status=openExamplesPost authentication, images and files downloading with simple filter or regular expression: from pynav import Pynavdef test1(): p = Pynav() p.go('http://www.example.com/connexion', {'login' : 'toto', 'pass' : 'toto'}) if p.find('My profile'): print 'connected into profile area' p.go('http://www.example.com/photos/') for image in p.get_all_images('.png'): p.download(image, '/tmp/images/') for link in n.get_all_links('download_part.*?\.zip'): p.download(link)Using HTTP Basic authentication, post authentication and cookie check:def test2(): p = Pynav(timeout=5) p.auto_referer=True p.set_http_auth('http://example.com', 'login', 'pass') p.go('http://example.com/private/') p.go('http://www.example.com/private/connexion', {'login' : 'toto', 'pass' : 'toto'}) if p.cookie_exists('id'): print 'Connected p.set_page_delay(2, 4) for link in p.get_all_links('news'): print link p.go(link) for page in p.history: print page, ':', pageUsing proxy: def test3(): p = Pynav(timeout=6, proxy='http://www.example.com:3128/') p.verbose=True p.referer = 'http://www.example.com' page = p.go('http://www.example.com/tracks') print p.strip_tags(page)


pynav Related Software