【问题标题】:Fill out HTML-InputFields which are not located in a form with Python mechanize使用 Python mechanize 填写不在表单中的 HTML-InputFields
【发布时间】:2011-10-26 09:04:12
【问题描述】:

我想用 mechanize 填写一个 HTML 输入字段,如下所示:

<input type="text" id="xy" name="xyz" [and some others] />

问题:它不在表单中,所以 br.select_form(...) 不起作用。如何访问该字段?选择全局形式和 br['xyz'] 也不起作用。还有第二个输入字段,它甚至没有要寻址的名称。

【问题讨论】:

  • 嗨,你发现了吗?

标签: python html forms mechanize


【解决方案1】:

似乎 javascript 将表单/字段放在页面上,Mechanize 不处理 javascript,请参阅此答案了解更多详细信息和替代解决方案 How to properly use mechanize to scrape AJAX sites

【讨论】:

    猜你喜欢
    • 2014-04-13
    • 2018-09-24
    • 2012-11-26
    • 1970-01-01
    • 1970-01-01
    • 2020-11-05
    • 1970-01-01
    • 1970-01-01
    • 2016-12-04
    相关资源
    最近更新 更多