资源简介
python爬虫实现自动填写问卷,具体使用介绍:https://blog.csdn.net/weixin_43863744/article/details/106166713
代码片段和文件信息
from selenium import webdriver
import random
import time
option = webdriver.ChromeOptions()
option.add_argument(‘headless‘)
url = ‘https://www.wenjuan.com/s/yYFBf2I/‘
t = 200
# 设置提交问卷次数
path=r“E:\PyCharm_workspace\pachong_1\chromedriver.exe“
for times in range(t):
driver = webdriver.Chrome(executable_path=pathoptions=option)
driver.get(url)
# 定位所有的问卷问题
questions = driver.find_elements_by_css_selector(‘.matrix‘)
for indexanswers in enumerate(questions):
# 定位所有问卷问题选项
answer = answers.find_elements_by_css_selector(‘.icheckbox_div‘)
# 定位需要填写文字的选项,并填入相关内容
# if not answer:
# blank_potion = answers.find_element_by_css_selector(‘.blank.option‘)
# blank_potion.send_keys(‘没有‘)
# continue
if index == 3 or index==4:
choose_ans=a
相关资源
- 易语言python支持库
- Python-BDD100K大规模多样化驾驶视频数据
- Instant Pygame for Python Game Development How
- Biopython Tutorial
- Think Python 2nd
- 一个小小的表白程序(python)
- Python课堂笔记(高淇400集第一季)
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 一个多线程智能爬虫,爬取网站小说
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- 顶点小说单本书爬虫.py
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
评论
共有 条评论