Python - 填写并提交HTML表单 [英] Python - Fill and submit a HTML Form

查看:137
本文介绍了Python - 填写并提交HTML表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用python在网页上填写并提交表单。我想与之交互的表单有几个下拉框,这些框用JavaScript填充。我查看了机械化库,但它不处理JavaScript。你可以建议一个替代的图书馆/方法与表单交互吗?



干杯,

Pete

解决方案


  1. Selenium RC或Windmill(http://www.getwindmill.com/)


  2. 检查表单的返回GET或POST值;
    使用urllib2直接提交合成请求。



I would like to fill in and submit a form on a web page using python. The form I want to interact with has several drop down boxes which are filled using JavaScript. I have looked at the mechanize library but it doesn't handle JavaScript. Can you suggest an alternate library/method for interacting with the form?

Cheers,

Pete

解决方案

  1. Selenium RC or Windmill (http://www.getwindmill.com/)

  2. Examine the form's returned GET or POST values; use urllib2 to submit synthesized requests directly.

这篇关于Python - 填写并提交HTML表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆