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

docker run wordpress优化工具箱

docker run wordpress,优化工具箱,网站策划与建设阶段的推广的目标,网页实时翻译器Selenium 是一个开源的 Web 应用程序自动化测试框架,主要用于模拟用户操作浏览器,支持功能测试、兼容性测试及管理任务自动化。 1.下载浏览器驱动 google:右上角三个点>设置>关于Chrome>查看版本>下载对应的webdriver 下载地址&#xff1…

Selenium 是一个开源的 Web 应用程序自动化测试框架,主要用于模拟用户操作浏览器,支持功能测试、兼容性测试及管理任务自动化。

1.下载浏览器驱动

google:右上角三个点>设置>关于Chrome>查看版本>下载对应的webdriver

下载地址:Chrome for Testing availability

Edge:右上角三个点>设置>关于Microsoft Edge>查看版本>下载对应的webdriver

下载地址:Microsoft Edge WebDriver |Microsoft Edge 开发人员

2.示例代码

import timefrom selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeServiceservice = ChromeService(executable_path=r"chromedriver.exe")
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)try:driver.get('https://www.baidu.com/index.htm')time.sleep(5)
except Exception as e:print(e)
finally:driver.quit()

元素定位使用Xpath

find_element(By.XPATH, "xpath_expression")  # xpath_expression使用浏览器F12,复制

扩展应用:

配合F12使用

import time
import pyperclip
import pyautogui
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ECservice = ChromeService(executable_path=r"D:\desktop\se\driver\chromedriver.exe")
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)try:driver.get('https://www.baidu.com/index.htm')time.sleep(3)# pyautogui.press('F12')# Ctrl + [ / Ctrl + ]  切换开发者工具面板pyautogui.hotkey('ctrl', 'shift', 'c')   # 'ctrl', 'shift', 'c' :元素检查模式       'ctrl', 'shift', 'j' :控制台(Console)time.sleep(2)for _ in range(3):  # 切换到网络pyautogui.hotkey('ctrl', ']')## WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "kw")))driver.find_element(By.ID,'kw').send_keys('大熊猫\n')time.sleep(1)pyautogui.hotkey('ctrl', 'f')# 复制文本到剪贴板pyperclip.copy("nicon_10750f3.png")# 粘贴内容pyautogui.hotkey('ctrl', 'v')pyautogui.press('enter')time.sleep(60)
except Exception as e:print(e)
finally:driver.quit()

http://www.dtcms.com/wzjs/504997.html

相关文章:

  • 网站建设前期准备工作网站域名注册
  • 建个什么网站赚钱网址大全实用网址
  • c 网站开发案例源码seo是什么字
  • 手机免费制作网站网络公司网站模板
  • 九江开发区建设规划局网站网络营销网站建设
  • 上犹建设局网站营销推广软件
  • 广州个人做网站百度推广关键词查询
  • 聚享游网站如何做推广腾讯会议付费
  • 上海十大公司嘉兴seo外包服务商
  • 做网站还有流量么女生学网络营销这个专业好吗
  • 大型网站怎么做seo关键词怎么选择技巧
  • 时时彩网站开发公司深圳百度seo哪家好
  • 腾讯云做网站教程网上有免费的网站吗
  • 沧州哪里可以做网站搜索引擎优化面对哪些困境
  • 网站模板 免费下载企业网站多少钱一年
  • qq靓号申请免费网站关键词查询网站
  • 关岭做网站推广app
  • 做跳转链接到自己的网站宁德市有几个区几个县
  • 网站开发与维护总结新产品推广方式有哪些
  • 网站后端怎么做网页设计框架图
  • 杭州蚂蚁 做网站的公司seo就业前景如何
  • 电商要多少钱才可以做深圳关键词推广整站优化
  • 推荐微信网站建设四川最好的网络优化公司
  • 温州市住房和城乡建设厅网站营销方案范文100例
  • 凡科快图怎么用企业关键词排名优化哪家好
  • 天津专门做网站的公司怎么查询最新网站
  • 网站建设代理政策电商运营培训
  • 湛江手机网站建设杭州网站优化平台
  • cpa游戏推广联盟热狗seo优化外包
  • 做日本淘宝网站免费发布推广信息的b2b