mechanize python click a button

前端 未结 1 745
萌比男神i
萌比男神i 2020-11-28 15:42

I have a form with button and would like to be able to click it.

I have tried mech.form.click(\"s

相关标签:
1条回答
  • 2020-11-28 16:16

    clicking a type="button" in a pure html form does nothing. For it to do anything, there must be javascript involved.

    And mechanize doesn't run javascript.

    So your options are:

    • Read the javascript yourself and simulate with mechanize what it would be doing
    • Use spidermonkey to run the javascript code

    I'd do the first one, since using spidermonkey seems hard and probably not worth it.

    0 讨论(0)
提交回复
热议问题