python - 使用 python mechanize 填充 <noscripts> 标签内的 textarea

标签 python textarea screen-scraping mechanize

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

示例网址: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>

最佳答案

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

实际上不是 Mechanize 可以填写的字段。

关于python - 使用 python mechanize 填充 <noscripts> 标签内的 textarea,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7231423/

相关文章:

objective-c - 如何在 Objective C 中使用 NSData 存储图像

python - 无法让 Scrapy 跟踪链接

python - 如何将数据集拆分/分区为训练和测试数据集,例如交叉验证?

python - 分配与全局变量同名的局部变量时出错

javascript - knockout : working with existing data

php - 在 php 中处理新行

css - 编写有效的 XHTML 文本区域?不能省略行和列?

ruby-on-rails - 在页面上查找匹配 HREF 模式的链接

Python:重新采样并向前填充到最近一个月

python - 如何从 pandas 数据帧中作为列显示的 json 格式数据中检索某些键和值