How to use mechanize in python to input a string into a certain part of a form? -
How to use mechanize in python to input a string into a certain part of a form? -
i trying utilize python submit big number of amino acids (stored strings) 1 @ time protein prediction website hosted expasy.org. store results each protein list. far have;
in[]: br = mechanize.browser() br.open("http://www.expasy.org/proteomics") response1 = br.follow_link(text_regex=r"tmpred", nr=1) in br.forms(): print
from here can see forms.
out[]: <post http://embnet.vital-it.ch/cgi-bin/tmpred_form_parser application/x-www-form-urlencoded <selectcontrol(outmode=[*html, ascii])> <selectcontrol(min=[14, 16, *17, 18, 19, 20, 21, 22, 23, 24, 25, 26])> <selectcontrol(max=[23, 25, 27, 29, 31, 32, *33, 34, 35, 37, 39, 41])> <textcontrol(comm=)> <selectcontrol(format=[*plain_text, readseq_convertible, swissprot_id, trembl_id, genpept_gi, yeast_orf])> <textareacontrol(seq=)> <submitcontrol(<none>=run tmpred) (readonly)> <ignorecontrol(<none>=<none>)>>
i can't figure out how select textbox or input strings textbox. know there has simple solution out reason can't find out there works. if out there has simpler solution please allow me know. thanks!
input, select, textarea tags has name. utilize name.
for example, input sequence format select tag has name format
:
br.select_form() # <----- pick form br['format'] = 'plain_text'
python python-2.7 web-scraping mechanize bioinformatics
Comments
Post a Comment