import time
from datetime import datetime
from random import randint
from requests_html import HTMLSession
# from spider_wjx.configs import (QUESTION_ID, QUESTION_URL, POST_URL_MAP, QUESTION_INFO, ANSWER_TIMES)
#改成自己的id
QUESTION_ID = 71699967
#问卷星答题地址
QUESTION_URL = "https://www.wjx.cn/m/{}.aspx".format(QUESTION_ID)
#题目数量,这里只要单选题目的数量
QUESTION_NUM = 14
# 提交问卷选项的url
POST_URL_MAP = "https://www.wjx.cn/joinnew/processjq.ashx?submittype=1&curID={}&t={}&starttime={}&rn={}"
QUESTION_INFO = '''
题目:{}
选项:{}
随机选择结果:{}
~~~~~~~~~~~~~~~~~~~~~~
'''
# 回答次数
ANSWER_TIMES = 200
def parse_post_url(resp):
'''
解析出提交问卷的url
'''
# 找到rn
rn = int(resp.html.search('rndnum="{}"')[0].split('.')[0])
# 提交问卷的时间
raw_t = round(time.time(), 3)
t = int(str(raw_t).replace('.', ''))
# 模拟开始答题时间
starttime = datetime.fromtimestamp(
int(raw_t) - randint(1, 60 * 3)).strftime("%Y/%m/%d %H:%M:%S")
url = POST_URL_MAP.format(QUESTION_ID, t, sta
问卷星的自动答题脚本
最新推荐文章于 2025-11-12 16:22:43 发布

最低0.47元/天 解锁文章
3万+

被折叠的 条评论
为什么被折叠?



