#目前仅支持无图片上传的问卷星活动报名自动化操作(ps:作者太菜,暂时实现不了上传图片)
#如果表单设置有开始时间,请在表单开始前1—2分钟运行程序,程序每隔2秒自动刷新
from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
import time
def TJ():
btn=browser.find_element(by=By.XPATH,value='''//*[@id="ctlNext"]''')
btn.click()
def input_infor():
t_input = browser.find_element(by=By.XPATH, value=f'''//*[@id="q{n}"]''')
t_input_Answer = answer_list[n-1]
t_input.send_keys(t_input_Answer)
num=3#有几个填空题就输入几
answer_list=list()
for i in range(num):
answer_list.append(" ")
answer_list[0]="张三"#输入第1个空的答案
answer_list[1]="应化202203"#输入第2个空的答案
answer_list[2]="202206054"#输入第3个空的答案
url="https://www.wjx.cn/vm/O0kQYsH.aspx# "
browser = Chrome()
flag=0
while(flag==0):
try:
browser.get(url)
for n in range(1,num+1):
input_infor()
TJ()
flag=1
except:
pass
time.sleep(2)
time.sleep(5)
10-25
4299
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)