【问题标题】:Fill in textarea within <noscripts> tags with python mechanize用 python mechanize 填充 <noscripts> 标签内的 textarea
【发布时间】:2011-08-29 14:23:21
【问题描述】:

我在从标签内机械化注册文本区域字段时遇到问题。

示例网址:http://www.gegononta.gr/register.php

代码:

mech = mechanize.Browser()
url = "http://www.gegononta.gr/register.php"
response = mech.open(url)

mech.select_form(nr=1)
mech.form.set_all_readonly(False)

print mech.form

输出:

<POST http://www.gegononta.gr/register.php application/x-www-form-urlencoded
<TextControl(reg_username=)>
<IgnoreControl(reg-checkbutton1=<None>)>
<TextControl(reg_email=)>
<IgnoreControl(reg-checkbutton2=<None>)>
<PasswordControl(reg_password=)>
<PasswordControl(reg_password2=)>
<HiddenControl(recaptcha_response_field=manual_challenge)>
<SubmitControl(submit=Create user)>
<HiddenControl(regfrom=full)>>

如何填写以下字段?

<textarea cols="40" rows="3" name="recaptcha_challenge_field"></textarea>

【问题讨论】:

    标签: python textarea screen-scraping mechanize


    【解决方案1】:
    <textarea cols="40" rows="3" name="recaptcha_challenge_field"></textarea>
    

    其实不是机械化可以填写的字段。

    【讨论】:

    • 但是为什么?除了在 noscript 标签中之外,我认为它与其他人没有什么不同。并且看到 mechanize 好像不使用 JS,它应该可以工作,对吧?
    猜你喜欢
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 2020-03-04
    • 2020-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-22
    相关资源
    最近更新 更多