我需要编写一个脚本,通过选择“Protein structure(Go to step 2b)”,然后在名为“pdbId”的文本字段中输入一些值,而不上载任何文件,从而在http://iedb.ebi.ac.uk/tools/ElliPro/iedb_input处自动提交表单。 我写了下面的脚本,但它给了我相同的页面没有任何提交发生。怎么了?在
import httplib2
http = httplib2.Http()
url = 'http://iedb.ebi.ac.uk/tools/ElliPro/iedb_input'
body = { 'pdbFile' : '', 'protein_type':'structure','pdbId':'5LYM' }
headers = {'Content-type': 'application/x-www-form-urlencoded','User-Agent':'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'}
response, content = http.request(url, 'POST', headers=headers, body=urllib.urlencode(body))
print content
我最后使用了mechanize,它成功了!在
相关问题 更多 >
编程相关推荐