Guest User

ptt

a guest
Dec 23rd, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import mechanize
  3. url = 'http://web.expasy.org/cgi-bin/peptide_mass/peptide-mass.pl?P35225'
  4. br  = mechanize.Browser(factory=mechanize.RobustFactory())
  5. br.set_handle_robots(False)
  6. br.open(url)
  7.  
  8. br.select_form(nr=0)
  9. br.form['protein']     = 'P35225'
  10. br.form['mandatory']   = ''
  11. br.form['reagents']    = ['nothing (in reduced form)', ]
  12. br.form['mplus']       = ['mh',]
  13. br.form['masses']      = ['monoisotopic',]
  14. br.form['enzyme']      = ['Trypsin',]
  15. br.form['MC']          = ['0',]
  16. br.form['minmass']     = ['500',]
  17. br.form['maxmass']     = ['unlimited',]
  18. br.form['order']       = ['mass',]
  19. br.form['modification']= ['on',]
  20. page2 = br.submit()
  21.  
  22. savefile = open('form.html', 'w')
  23. HTML     = page2.read()
  24. savefile.write(HTML)
  25. savefile.close()
Advertisement
Add Comment
Please, Sign In to add comment