月と年の入力を指定してMexico's centralからドロップダウン値を抽出しようとしていますが、実行するたびにクロムウィンドウを開きたくないため、私のスクリプト。ここで私はこれまで試したものです:Banxicoのドロップダウンボックスからのインフレーションの解消
ツイル
from twill.commands import *
go("http://www.banxico.org.mx/portal-inflacion/inflacion.html")
showforms()
Output: Form name=_BBM_MenuForm (#1)
## ## __Name__________________ __Type___ __ID________
__Value__________________
1 url hidden url
/AplBusquedasBM2/bgenwww_in.jsp
2 appname hidden appname bmsearch
3 _action hidden _action search
4 _lang hidden _lang es
5 _userquery text _userquery Buscar...
6 submit submit (None)
7 _P_BM_Deposito select _P_BM_De ... ['B', 'M', '_', 'W', 'W', 'W', ';', ...
を私はsubmit
入力は、私が探していると思うが、私は表示されませんどのように入力月と年のデータへ。
Mechanizeの
import mechanize
br = mechanize.Browser()
b = br.open("http://www.banxico.org.mx/portal-inflacion/inflacion.html")
b.select_form(nr=0)
form = br.form
print(form)
Output:
Traceback (most recent call last):
File "pago_ext.py", line 16, in <module>
b.select_form(nr=0)
File "/usr/local/lib/python2.7/dist-packages/mechanize/_response.py", line 106, in __getattr__
return getattr(wrapped, name)
AttributeError: closeable_response instance has no attribute 'select_form'
どのように私は、私はHTMLについて多くを知らない考慮のドロップダウンメニューにアクセスすることができます?