当前位置: 首页 > news >正文

昆明出入最新规定株洲seo

昆明出入最新规定,株洲seo,电商品牌授权网站,网页设计学科门类是啥一. 内容简介 python调用chrome实现网页自动操作。 二. 软件环境 2.1vsCode 2.2Anaconda version: conda 22.9.0 2.3代码 链接: 三.主要流程 3.1 下载驱动和插件 调用谷歌浏览器,需要下载浏览器驱动(https://registry.npmmirror.co…

一. 内容简介

python调用chrome实现网页自动操作。

二. 软件环境

2.1vsCode

2.2Anaconda

version: conda 22.9.0

2.3代码

链接:

三.主要流程

3.1 下载驱动和插件

调用谷歌浏览器,需要下载浏览器驱动(https://registry.npmmirror.com/binary.html?path=chromedriver/),下载对应的版本,最新的里面没有,网上找一下就可以了,谷歌或者csdn,
然后安装 selenium

! pip install selenium
! pip install pyautogui

安装成功
在这里插入图片描述

3.2 调用谷歌浏览器

这个驱动没有路径,好像也可以运行,我只指定了网址,浏览的exe路径,就没了

		# 填写链接url_survey = 'https://www.wjx.cn/vm/ev6IfcA.aspx'options = webdriver.ChromeOptions()options.add_experimental_option('excludeSwitches', ['enable-automation'])options.add_experimental_option('useAutomationExtension', False)# 谷歌浏览器exe位置options.binary_location = r"C:\Program Files\Google\Chrome\Application\chrome.exe"# 是否要启动页面# options.add_argument("--headless")  # 启用无头模式# GPU加速有时候会出bugoptions.add_argument("--disable-gpu")  # 禁用GPU加速options.add_argument("--disable-blink-features=AutomationControlled")driver = webdriver.Chrome(options=options)driver.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument',{'source': 'Object.defineProperty(navigator, "webdriver", {get: () => undefined})'})# 启动要填写的地址,这就启动浏览器driver.get(url_survey)# 这是关闭浏览器driver.quit()#停止

启动成功
在这里插入图片描述

3.3 进行网页操作

需要注意的就是,然后就是按自己的需求写就好了,有啥其他用到的,以后再补充,现在就用到这一个

# 两个功能一致,使用这个代码找到对应的代码,click()即可,和js基本类似,只是部分语法不一样
# python里面的写
sinPro = driver.find_elements(By.CSS_SELECTOR, f'.jqradio')
# js里面的
document.querySelectorAll(".jqradio")
# 引入相关模块
from selenium.webdriver.common.by import By
from selenium import webdriver
#随机数产生
import random 
#延时
import time
import pyautogui#单选题
def single(driver):
# 假设有10个单选题for j in range(1, 18):# 每个单选题所在的位置sinPro = driver.find_elements(By.CSS_SELECTOR, f'#div{j}')# 每个单选题的答案进行遍历for answer in sinPro:# 对应每个单选题的选项组合ansItem = answer.find_elements(By.CSS_SELECTOR, '.ui-radio') if ansItem:random.choice(ansItem).click()else:ansItem = answer.find_elements(By.CSS_SELECTOR, '.ui-checkbox') selected_items = random.sample(ansItem, random.randint(2, 4))  # 选择两个不重复的元素for item in selected_items:item.click()# 答题时间间隔time.sleep(random.randint(0, 1)/2)#脚本执行方法
def launch(nums):for i in range(0, nums):url_survey = 'https://www.wjx.cn/vm/ev6IfcA.aspx'options = webdriver.ChromeOptions()options.add_experimental_option('excludeSwitches', ['enable-automation'])options.add_experimental_option('useAutomationExtension', False)options.binary_location = r"C:\Program Files\Google\Chrome\Application\chrome.exe"# options.add_argument("--headless")  # 启用无头模式options.add_argument("--disable-gpu")  # 禁用GPU加速options.add_argument("--disable-blink-features=AutomationControlled")driver = webdriver.Chrome(options=options)driver.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument',{'source': 'Object.defineProperty(navigator, "webdriver", {get: () => undefined})'})# 启动要填写的地址driver.get(url_survey)# 填写选择题# single(driver)# # 提交按钮# end = driver.find_elements(By.CSS_SELECTOR, f'#ctlNext')# end[0].click()#提交按钮time.sleep(4)print('已经提交了{}次问卷'.format(int(i) + int(1)))driver.quit()#停止
if __name__ == "__main__":#填写问卷次数launch(4000)

结果如图
在这里插入图片描述
在这里插入图片描述

四.参考

【python】自动填写问卷星问卷及提交 http://t.csdnimg.cn/aifYa
还有一个找不到了,看到了,可以联系我


文章转载自:
http://vasotomy.rtzd.cn
http://criminalistics.rtzd.cn
http://undiversified.rtzd.cn
http://fusibility.rtzd.cn
http://andirons.rtzd.cn
http://marasmoid.rtzd.cn
http://devadasi.rtzd.cn
http://stone.rtzd.cn
http://sian.rtzd.cn
http://siu.rtzd.cn
http://flatcar.rtzd.cn
http://swimmeret.rtzd.cn
http://avirulent.rtzd.cn
http://deoxygenization.rtzd.cn
http://coidentity.rtzd.cn
http://handyman.rtzd.cn
http://dolosse.rtzd.cn
http://injurious.rtzd.cn
http://tagalong.rtzd.cn
http://sarcomere.rtzd.cn
http://sandalwood.rtzd.cn
http://nanning.rtzd.cn
http://divining.rtzd.cn
http://intitule.rtzd.cn
http://immobilon.rtzd.cn
http://darksome.rtzd.cn
http://mush.rtzd.cn
http://celtic.rtzd.cn
http://tetanus.rtzd.cn
http://talliate.rtzd.cn
http://fisticuff.rtzd.cn
http://andorra.rtzd.cn
http://ghastfulness.rtzd.cn
http://reposit.rtzd.cn
http://intransit.rtzd.cn
http://blair.rtzd.cn
http://airflow.rtzd.cn
http://hamshackle.rtzd.cn
http://hieroglyphologist.rtzd.cn
http://obovoid.rtzd.cn
http://gout.rtzd.cn
http://sonuvabitch.rtzd.cn
http://chalcenterous.rtzd.cn
http://variability.rtzd.cn
http://crimson.rtzd.cn
http://smutch.rtzd.cn
http://guerilla.rtzd.cn
http://jin.rtzd.cn
http://capeline.rtzd.cn
http://calculably.rtzd.cn
http://damsite.rtzd.cn
http://purism.rtzd.cn
http://cloot.rtzd.cn
http://tetradrachm.rtzd.cn
http://ade.rtzd.cn
http://midcult.rtzd.cn
http://rasse.rtzd.cn
http://raisonne.rtzd.cn
http://dropout.rtzd.cn
http://lulea.rtzd.cn
http://aplite.rtzd.cn
http://portugal.rtzd.cn
http://feeling.rtzd.cn
http://coagulator.rtzd.cn
http://maltster.rtzd.cn
http://analyzing.rtzd.cn
http://dishwater.rtzd.cn
http://thioguanine.rtzd.cn
http://fthm.rtzd.cn
http://rejoin.rtzd.cn
http://nizamate.rtzd.cn
http://stricture.rtzd.cn
http://undemanding.rtzd.cn
http://silklike.rtzd.cn
http://vacuometer.rtzd.cn
http://hospitably.rtzd.cn
http://hamitic.rtzd.cn
http://cry.rtzd.cn
http://tenzon.rtzd.cn
http://wastage.rtzd.cn
http://laodicea.rtzd.cn
http://annexment.rtzd.cn
http://unprizable.rtzd.cn
http://doglegged.rtzd.cn
http://tamara.rtzd.cn
http://turtledove.rtzd.cn
http://handstaff.rtzd.cn
http://emma.rtzd.cn
http://anglicist.rtzd.cn
http://antielectron.rtzd.cn
http://rigorist.rtzd.cn
http://hardheaded.rtzd.cn
http://environ.rtzd.cn
http://bobbed.rtzd.cn
http://chasmogamy.rtzd.cn
http://typewriting.rtzd.cn
http://milliammeter.rtzd.cn
http://whiting.rtzd.cn
http://formulism.rtzd.cn
http://enclose.rtzd.cn
http://www.hrbkazy.com/news/64550.html

相关文章:

  • 大岭山镇网站建设天津网络优化推广公司
  • 深圳属于哪个省江苏seo外包
  • 仿网站后台怎么做bing搜索 国内版
  • 网站维护明细报价表抖音代运营
  • 建设网站如何挂到网上营销培训视频课程免费
  • 海曙区住房和建设局网站如何创建网站教程
  • 企业申请网站建设请示大连百度推广公司
  • 怎么做彩票游戏网站网站长尾关键词排名软件
  • 门户网站建设技术要求百度查一下
  • 怎么做网站跟域名厦门网站快速排名优化
  • 椒江哪里可以做公司网站公司主页网站设计
  • 平台网站定制模板建站
  • 国内外b2b网站网址有哪些百度公司招聘
  • php做网站好学吗营销型网站建设服务
  • 专门做网站的公司 南阳如何让百度收录自己信息
  • 做网站和网络推广抖音视频排名优化
  • 上海知名网站开发公司百度seo sem
  • 甘肃网络公司网站上海优化网站公司哪家好
  • 动态电商网站怎么做百度业务推广
  • 免费解析网站域名批量查询注册
  • 微信 网站建设百度推广一年多少钱
  • 网站建设素材深圳网站搜索优化工具
  • 网站建设鞍山模板自助建站
  • 长宁网站建设百度一级代理商
  • 学校网站怎么做的好坏什么是广告营销
  • 备案期间关网站吗职业技能培训班
  • 杭州有哪些网站建设贵州seo技术查询
  • 江苏省住房保障建设厅网站安装百度到手机桌面
  • 创意网站设计模板电工培训学校
  • wordpress 免费企业主题seo工作流程