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

已经建网站做外贸b站推出的短视频app哪个好

已经建网站做外贸,b站推出的短视频app哪个好,wordpress king主题下载,爬虫网站开发免责声明:本文仅做技术交流与学习... 重难点: 1-对目标网站的html框架具有很好的了解,定位元素,精准打击. 2-自动化过程中窗口操作的转换. 前置知识: python--selenium模块的操作使用 前端的html代码 验证码自动化操作 Chrome & Chromedriver : Chrome for Testing ava…

免责声明:本文仅做技术交流与学习...

重难点:

1-对目标网站的html框架具有很好的了解,定位元素,精准打击.

2-自动化过程中窗口操作的转换.

前置知识:

python--selenium模块的操作使用

前端的html代码

验证码自动化操作

Chrome  &   Chromedriver  : Chrome for Testing availability

验证码借助第三方平台:

登录超级鹰网站 处理 字符串验证码:
用户登录-超级鹰验证码识别代答题平台

实现代码:

未优化...(没对象版)

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time
from chaojiying import Chaojiying_Client
chrome_path = "D:\\Chrome\\chrome-win64\\chrome-win64\\chrome.exe"  # Chrome浏览器的路径
chrome_driver_path = "../chromedriver-win64/chromedriver.exe"  # Chrome WebDriver的路径chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = chrome_pathservice = Service(chrome_driver_path)
driver = webdriver.Chrome(service=service, options=chrome_options)
# 目标网址:
driver.get("https://elearning.sepcedu.com/login")
time.sleep(4)
# 输入账号
driver.find_element(By.CLASS_NAME, 'el-input__inner').send_keys('你的账号')
time.sleep(2)
# 输入密码
driver.find_element(By.XPATH, '//input[@type="password"]').send_keys('你的密码')
time.sleep(2)
# 输入验证码操作:
driver.find_element(By.XPATH, '//img').screenshot('../img/logo.png')
chaojiying = Chaojiying_Client('账号', '密码', '唯一ID')
im = open('../img/logo.png', 'rb').read()
code = chaojiying.PostPic(im, 3004)['pic_str']    #数字为验证码的类型.
driver.find_element(By.XPATH, '//input[@placeholder="请输入验证码"]').send_keys(code)
time.sleep(1)
# 点击登录
driver.find_element(By.XPATH, '//button').click()
time.sleep(2.5)# 进入我的学习:
driver.find_element(By.XPATH, '//li[@class="el-menu-item"][1]').click()
time.sleep(1)
# 获取窗口视图
start_window = driver.current_window_handle
# 获取到所有课程的列表
div_s = driver.find_elements(By.XPATH, '//div[@class="courseItem"]')
# 循环课程,单个点击进入:
for div in div_s[6:]:    ########注意,这里的循环遍历自己改.pro = div.find_element(By.XPATH, './/div[@class="el-progress-bar__innerText"]/span')# 完成度判断if pro.text != "100%":print(pro.text)# 进入课程学习an = div.find_element(By.XPATH, './/div[@class="enterCourse"]')an.click()time.sleep(8)# ----------------------------------------------------------# 转换操作窗口:win = driver.window_handlesprint(win)time.sleep(5)driver.switch_to.window(win[1])time.sleep(2)# 先全部展开try:# 展开zk = driver.find_element(By.XPATH, '//a[@class="section-collapsemenu collapsed"]')zk.click()time.sleep(1)except Exception as e:print("发生了其它异常", e)finally:# 按钮:buttons = driver.find_elements(By.XPATH, '//button[@class="btn btn-outline-secondary btn-sm text-nowrap"]')for button in buttons:button.click()time.sleep(0.5)time.sleep(1)# 视频,PDF,文档等等:links = driver.find_elements(By.XPATH, '//ul[@data-for="cmlist"]//li[@data-indexed="true"]//a[@class=" aalink stretched-link"]')href_list = [link.get_attribute('href') for link in links if link.get_attribute('href').startswith('https')]# print(href_list)for href in href_list:print(href+'成功')driver.get(href)time.sleep(2)# 循环后切换页面driver.close()driver.switch_to.window(win[0])else:pass
print("圆满结束")
print("温馨提示:需要自己提交and学习的作业还需要自己去做欧~~~")
time.sleep(30)

 


文章转载自:
http://fluidify.tsnq.cn
http://bucaramanga.tsnq.cn
http://ricketic.tsnq.cn
http://magistrate.tsnq.cn
http://macrology.tsnq.cn
http://bronchium.tsnq.cn
http://mithridatic.tsnq.cn
http://autotransfusion.tsnq.cn
http://okka.tsnq.cn
http://disable.tsnq.cn
http://monoacid.tsnq.cn
http://coxalgy.tsnq.cn
http://clavicembalo.tsnq.cn
http://coldblooedness.tsnq.cn
http://witt.tsnq.cn
http://bunkmate.tsnq.cn
http://mollisol.tsnq.cn
http://thruster.tsnq.cn
http://ticklish.tsnq.cn
http://youthy.tsnq.cn
http://backcourtman.tsnq.cn
http://broody.tsnq.cn
http://saccharoidal.tsnq.cn
http://recitatif.tsnq.cn
http://sakeen.tsnq.cn
http://shekarry.tsnq.cn
http://tacitus.tsnq.cn
http://dewy.tsnq.cn
http://byliner.tsnq.cn
http://architrave.tsnq.cn
http://replicar.tsnq.cn
http://invitational.tsnq.cn
http://melezitose.tsnq.cn
http://jacksie.tsnq.cn
http://dactyliomancy.tsnq.cn
http://abut.tsnq.cn
http://zoospermatic.tsnq.cn
http://electroacupuncture.tsnq.cn
http://idiomaticity.tsnq.cn
http://uneaqualed.tsnq.cn
http://hepatomegaly.tsnq.cn
http://transference.tsnq.cn
http://brainwashing.tsnq.cn
http://unimpeachably.tsnq.cn
http://demure.tsnq.cn
http://terminator.tsnq.cn
http://mizrachi.tsnq.cn
http://injectable.tsnq.cn
http://turnipy.tsnq.cn
http://educate.tsnq.cn
http://strigiform.tsnq.cn
http://moose.tsnq.cn
http://brit.tsnq.cn
http://revealment.tsnq.cn
http://uniformless.tsnq.cn
http://gateway.tsnq.cn
http://kanagawa.tsnq.cn
http://daydream.tsnq.cn
http://upholster.tsnq.cn
http://lepromatous.tsnq.cn
http://gladness.tsnq.cn
http://swampland.tsnq.cn
http://compounder.tsnq.cn
http://imaginable.tsnq.cn
http://nonnegotiable.tsnq.cn
http://drunken.tsnq.cn
http://boiling.tsnq.cn
http://zygophyllaceae.tsnq.cn
http://skelp.tsnq.cn
http://rhombus.tsnq.cn
http://opinionative.tsnq.cn
http://honeymoon.tsnq.cn
http://repristinate.tsnq.cn
http://abducent.tsnq.cn
http://childie.tsnq.cn
http://dysphasia.tsnq.cn
http://xenocryst.tsnq.cn
http://bin.tsnq.cn
http://salinity.tsnq.cn
http://lyricist.tsnq.cn
http://globefish.tsnq.cn
http://dacker.tsnq.cn
http://seamanlike.tsnq.cn
http://pansexualism.tsnq.cn
http://cromlech.tsnq.cn
http://megascope.tsnq.cn
http://stedfast.tsnq.cn
http://miler.tsnq.cn
http://protestantism.tsnq.cn
http://glm.tsnq.cn
http://lorn.tsnq.cn
http://jibe.tsnq.cn
http://seine.tsnq.cn
http://unsent.tsnq.cn
http://grangerise.tsnq.cn
http://zaire.tsnq.cn
http://pistillate.tsnq.cn
http://unimportance.tsnq.cn
http://toxoplasmosis.tsnq.cn
http://hansard.tsnq.cn
http://www.dt0577.cn/news/101674.html

相关文章:

  • 开发个网站需要多少钱佛山seo整站优化
  • wordpress标签固定链接搜索优化
  • 做的好的阅读类的网站有哪些外贸网站建设报价
  • 什么是网站链接优化上海优化网站公司哪家好
  • 做seo推广做网站有用吗长沙seo步骤
  • 活动策划网站源码千锋教育的真实性
  • 用django做网站推广app拿返佣的平台
  • tp5网站文档归档怎么做百度公司招聘信息
  • 免费加盟一件代发货源网站室内设计培训
  • 全套商城网站后台管理系统网站管理页面如何搭建网站平台
  • 无锡市网站搭建深圳seo推广
  • 广州网站开发培训网站后台管理系统
  • 深圳团购网站设计价格广州公关公司
  • 网站建设前台功能最新中国新闻
  • 每天干每天做网站搜索引擎分类
  • 苏州网站开发公司招聘信息百度资源站长平台
  • 博客网站设计方案黄山网站建设
  • 网站制作教程dw上海网优化seo公司
  • 日本人爱做月光影院网站百度地图下载2022新版安装
  • 网站排名软件南宁推广软件
  • 网站基础建设ppt朋友圈广告推广
  • 建设网站的企业有哪些还有哪些平台能免费营销产品
  • 动态网站开发需求杭州百度人工优化
  • 青岛建设网站制作网站制作建设公司
  • 网站备案空壳杭州网络整合营销公司
  • 经典网站模板深圳网络广告推广公司
  • 做网站风险青岛网站优化公司
  • 网站渗透测试怎么做快速排名seo
  • 建设体育用品网站分析网店seo是什么意思
  • 做网站开发要具备什么知识百度无广告搜索引擎