问题描述
现在,我正在使用iMacros从网上提取数据并填写提交数据的表格.
Now I'm using iMacros to extract data from a web and fill forms submitting the data.
但是iMacros是一种昂贵的工具.我需要一个免费的图书馆,并且我已经阅读了有关Scrapy的数据挖掘.使用它编程时,我有点麻烦,但要遵守金钱规则.
But iMacros is a expensive tool. I need a free library and I've read about Scrapy for data minning. I's a litle more complex to programming with it but the money rules.
问题是我是否可以用Scrapy填充html表单并提交到网页.我不想使用Javascript,我想只使用Python脚本.
The question is if I can fill html forms with Scrapy and submit to the web page. I don't want to use Javascript, I want to use exclusively Python scripts.
我在 http://doc.scrapy.org/中进行了搜索,但没有找到任何相关信息提交表格.
I searched in http://doc.scrapy.org/ but I didn't found nothing about form-submit.
推荐答案
使用scrapy.http.FormRequest
类.
FormRequest类将基本Request扩展为具有处理HTML表单的功能
The FormRequest class extends the base Request with functionality for dealing with HTML forms
http://doc.scrapy.org/zh_CN/latest/topics/request-response.html#formrequest-objects
这篇关于我可以用Scrapy填写Web表单吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!