Giter Club home page Giter Club logo

wjx_autosubmit's Introduction

Gitpod ready-to-code Gitpod ready-to-code

更新

2021-01-19

又是一年过去,再次打开自己的划水项目。看看问卷星又上了哪些反爬虫机制。目前问卷星部署了阿里云的人机验证,cookies中新增了一些参数。本人才疏学浅,且懒,导致无法继续。在此留下一些参考项目已供后者参考。

WJX_Autosubmit

问卷星自动提交,Python3版本,2020年8月仍有效。采用构建随机答案,不支持验证码。

目前github上的可用版本并不多,同时个人接触较多问卷星的问卷,便萌生了用Python3的爬虫来完成问卷的想法,同时,作为学习的项目。

程序运行

  1. 安装依赖。

pip install -r requirements.txt

帮助信息

    Usage: WJX_Autosubmit.py [OPTIONS]

    Options:
    -p or --pool   use proxy from github.com/jhao104/proxy_pool
    -l or --list   use proxy from www.proxy-list.download
    -h or --help  Show this message and exit.

使用例子

说明

如上图所示,20份问卷中有5份由于代理不可用而提交失败(有些时候,程序出现异常跳过会导致总数不一致的情况)。目前项目提供两个代理来源选择,在抓取所选来源的代理后,会进行一次校验。尽管源头已进行过筛选,但是依然有出现代理不可用的情况。在向问卷星进行提交时,筛选过的代理依然会出现代理不可用的情况。目前在每次运行程序完成时,会将无效代理从代理存储文件中删除,当程序运行次数越多,就可以达成有效提交次数越多的情况。

强烈建议代理存储文件仅当天保留,之后运行时可删除,程序会自行从所选代理来源抓取新的代理。

当然也可以自己采用付费https代理。

重要说明

请优先采取使用proxy-list的代理。

代理存储文件

如选择从 proxy_list 获取代理,程序会先保存为 proxy_list.list,将验证后代理保存为 proxy_pool_temp.list

这两个代理来源的区别是,proxy_list 的有效代理数量更多,国外代理的数量相比国内更多,proxy_pool则相反。

鸣谢

Bugs

程序仅支持固定问题的问卷,并不支持问题动态变化的问卷。

欢迎对不同种类问卷进行适配并提交pull request.

在此推荐一个适配多种题型的项目。

更新日志

V 1.0 2019年8月9日完成

  • 使用西刺代理。

2.0 2020年8月20日完成

  • 更换代理来源
  • 引入多线程验证
  • 增加启动参数
  • 匹配问卷星新headers。
  • 自定义模块使用面向对象方法

已弃坑

wjx_autosubmit's People

Contributors

normanbb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wjx_autosubmit's Issues

代理IP共享计划

相关方发了Email给我,我觉得很有趣。故分享出来。

小全代理,这是一个免费HTTP隧道代理,也是一个代理IP的共享计划。
当您共享自己的IP时,也可以免费使用别人共享的代理IP,互联网的精神不就是:“我为人人,人人为我”吗?
我们诚挚的邀请您加入"代理IP共享计划",有了您贡献的力量,小全代理共享IP计划会更美好!!!
官网地址: http://www.full-proxy.com

运行报错

错误提示没有proxy_pool_temp.list这个文件,是需要我自己去生成吗,我看代码里直接指定file_name = 'proxy_pool_temp.list'
Screenshot from 2020-08-27 16-44-57

疑问

您好,想问下 使用您的那个代码报错了

File "f:/interseting programs/AUTO wjx/main.py", line 133, in main
if int(result) in [10]:
ValueError: invalid literal for int() with base 10: '9〒'
是什么原因呢

填空题被卡

问卷星中的必答填空题会被卡,没有办法提交

网页返回22

网页返回22是因为提交的网址又改了吗,我抓包没看出来,望大佬指点下😣

已经挂了

use proxy from www.proxy-list.download
开始验证代理
验证代理完成,用时: 17.91 s
使用验证proxy-list代理
输入问卷地址:
输入提交次数:30
程序开始运行
代理 159.8.114.37:80 不可用
代理 119.81.189.194:8123 不可用
代理 69.28.62.166:3128 不可用
代理 119.81.189.194:80 不可用
代理 169.57.157.148:8123 不可用
代理 159.8.114.34:8123 不可用
代理 159.8.114.37:8123 不可用
代理 169.57.157.148:80 不可用
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
代理 169.57.157.146:8123 不可用
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
[ Response : 22 ] ===> 提交失败!!!!
程序运行结束,成功提交0份调查报告

代理ip后的验证码问题

脚本刚开始有效,当使用成功了5次后出现了验证要求,很郁闷不知道为啥,ip代理看后台之前提交记录应该是对的,不知道为啥突然要验证了,返回信息如下
Snipaste_2019-10-30_10-50-11

代理ip无法提交的问题

通过fiddler抓取问卷星参数,通过request的post进行提交,未添加代理ip,可以成功提交,添加ip后,直接提交失败
image
为了验证ip代理是否成功,在提交前先查询当前的代理ip是否有效,结果ip有效,提交失败
image
在这一步卡住了

关于get_fill_content()函数的一点修改与建议

今天我测试了一下这个脚本发现还是可以用的,我是提交固定答案所以没有测试随机选择的功能,在测试过程中发现get_fill_content()函数中的 res = requests.get(url, headers=headers)有时会丢失与服务器的链接而导致程序意外停止,所以做了一点修改如下:
def get_fill_content(url):
headers = {
'user-agent': UserAgent().random
}
res=None
while res is None:
try:
res = requests.get(url, headers=headers,timeout=5)
except:
pass
cookies = res.cookies
return res.text,cookies
经测试稳定很多,不会出现意外停止了

脚本运行失败

2020.9.07
依赖安装好之后运行脚本,总是出现以下报错:
WJX_Autosubmit-master>python WJX_Autosubmit.py -l

    本程序用于构建随机答案填写问卷星问卷

use proxy from www.proxy-list.download
开始验证代理
验证代理完成,用时: 0.53 s
使用验证proxy-list代理
输入问卷地址:https://www.wjx.cn/m/90368218.aspx
输入提交次数:20
程序开始运行
Traceback (most recent call last):
File "WJX_Autosubmit.py", line 235, in
main(times)
File "WJX_Autosubmit.py", line 155, in main
ip_list = proxy.choose_proxy(filename)
File "D:\Users\小火柴\Desktop\问卷星\WJX_Autosubmit-master\fake_info.py", line 58, in choose_proxy
with open(filename, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'proxy_list_temp.list'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.