ICode9

精准搜索请尝试: 精确搜索
  • 爬虫 - 解决 Executable path has been deprecated please pass in a Service object in Selenium Python 问题2022-05-01 11:31:34

    # 1. 错误描述 # 2. 错误原因 出现 DeprecationWarning 警告的类型错误:该类型的警告大多属于版本更新时,所使用的方法过时的原因,他在当前版本被重构,还可以传入参数,但是在之后的某个版本会被删除. 查询当前版本重构后的函数,是之前的 executable_path 被重构到了 Service 函数里,如

  • Python 中使用 Selenium WebDriver 截取部分截图2022-04-30 11:03:36

    from selenium import webdriverfrom PIL import Imagefrom io import BytesIO driver= webdriver.Chrome()driver.get('你的网页URL') ##按照页面进行元素定位element = driver.find_element_by_xpath('你的元素')##获取你的坐标{X,Y}location = element.location##获取高度跟宽

  • 《手把手教你》系列基础篇(九十六)-java+ selenium自动化测试-框架之设计篇-跨浏览器(详解教程)2022-04-29 09:01:53

    1.简介 从这一篇开始介绍和分享Java+Selenium+POM的简单自动化测试框架设计。第一个设计点,就是支持跨浏览器测试。 宏哥自己认为的支持跨浏览器测试就是:同一个测试用例,支持用不同浏览器去执行。我们这里只考虑Windows平台的浏览器,而且只关注火狐和谷歌浏览器的自动化测试,我们已经

  • selenium+Java处理iframe切换2022-04-28 21:02:33

    selenium+Java处理iframe切换有3种方法: 1、如果iframe有id或name,则可根据iframe的id或name切换。 2、把iframe当作页面元素,通过元素定位表达式进行切换。 3、将iframe存储到list中,然后根据ifrane的索引定位 (适合页面有多个iframe,且前两种方法无法使用)。 如果页面有多层iframe嵌套,

  • Spark运行架构2022-04-24 21:01:26

    一 Spark与hadoop 三 Spark的架构详解 四 Spark运行基本流程 五 Spark运行模式 5.1 standalone独立集群运行模式 5.1.1 Standalone的client模式 5.1.2 Standalone的cluster模式 5.1.3 YARN框架原理 5.1.4 YARN的client运行模式 5.1.5 YARN的cluster运行模式 5.1.6 YARN-Cl

  • selenium定位:多窗口控制2022-04-24 00:34:03

    使用百度多窗口演示,见下面web UI自动化脚本: 1 from selenium import webdriver 2 # 之前的 executable_path 被重构到了 Service 函数里 3 # 出错更新,https://blog.csdn.net/m0_62298204/article/details/120802053 4 from selenium.webdriver.chrome.service import Service

  • 学习笔记--idea连接mysql数据库2022-04-23 18:02:04

    ​ 报错信息: Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 做一个简单的jdbc样例 public class JDBCDemo { public static void main(String[] args) throws Exception{ Class.forName("com.mysql.jdbc.Driver&quo

  • Python 阿里云盾滑块验证2022-04-23 03:00:52

    本文仅供学习交流使用,如侵立删! 记一次阿里云盾滑块验证分析并通过 操作环境 win10 、 mac Python3.9 selenium、pyautogui 分析 最近在做中国庭审公开网数据分析的时候发现每次打开一个新的页面都会触发滑块验证,就长下面这个样子 本以为使用selenium定位到滑块元素拖动即可,满

  • 不懂PO 设计模式?这篇实战文带你搞定 PO2022-04-22 17:01:23

    为UI页面写测试用例时(比如web页面,移动端页面),测试用例会存在大量元素和操作细节。当UI变化时,测试用例也要跟着变化, PageObject 很好的解决了这个问题! 使用UI自动化测试工具时(包括selenium,appium等),如果无统一模式进行规范,随着用例的增多会变得难以维护,而 PageObject 让自动化脚本井

  • python selenium练习2022-04-22 13:02:59

    import time from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By # 实例化driver对象 driver = webdriver.Chrome()

  • [ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [5].2022-04-22 11:33:42

    当这个出现时在cmd命令中cliconfig会弹出这样一个界面 把TCP/IP加到启用列表中,然后应用并确定。主机名或IP地址那里改为 ip,port 详细操作请看:::https://blog.csdn.net/luke312/article/details/114652572

  • selenium基础:控制浏览器2022-04-21 13:04:22

    控制浏览器窗口大小 设置浏览器宽480,高800 set_window_size(480,800) 设置浏览器全屏 maximize_window() 控制浏览器前进、后退 模拟浏览器前进 forward() 模拟浏览器后退 back() # 百度为例 from selenium import webdriver import time driver = webdriver.Firefox() dri

  • WebDriverManager实现自动获取浏览器驱动(Java)2022-04-20 22:34:44

    介绍自动到指定的地址下载相应的浏览器驱动保存到缓存区 ~/.cache/selenium解决更新,升级driver,需要重新下载驱动的问题支持多种浏览器,允许设置浏览器版本,系统版本,代理服务器信息代替传统的下载driver驱动,使用System.setProperty 设置路径,或者配置path 环境变量 System.setProper

  • 技术分享 | SeleniumIDE用例录制2022-04-19 15:32:44

    1、录制回放方式的稳定性和可靠性有限 2、只支持 Firefox、Chrome 3、对于复杂的页面逻辑其处理能力有限 环境准备 Chrome 插件:https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd Firefox 插件:Selenium IDE – Get this Extensio

  • 技术分享 | SeleniumIDE用例录制2022-04-19 09:33:57

    ⬇️ 点击“下方链接”,提升测试核心竞争力! >>更多技术文章分享和免费资料领取 原文链接 1、录制回放方式的稳定性和可靠性有限 2、只支持 Firefox、Chrome 3、对于复杂的页面逻辑其处理能力有限 环境准备 Chrome 插件:https://chrome.google.com/webstore/detail/selenium-

  • JDBC---连接2022-04-18 10:02:51

    package connection; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; import org.junit.Test; public clas

  • Select多选框下拉列表2022-04-18 01:00:27

    Select多选框下拉列表   在做自动化的过程中,我们经常会遇到select标签类型的多选框下拉列表。针对select标签类型,selenium中有封装好的API可以使用,接下来,我们一起看看关于select多选框下拉列表的操作方法吧。 操作方法简介 1、选择下拉列表方法 selectByIndex(index); // 根

  • Selenium(19):取消chrome受自动控制提示2022-04-17 21:32:40

    取消chrome受自动控制提示 代码示例: def __get_chrome_driver(self): """获取谷歌的驱动并执行""" # 取消chrome受自动控制提示 chrome_options = Options() chrome_options.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性

  • JavaScript在web自动化中的应用2022-04-17 03:00:05

    JavaScript在web自动化中的应用 某些特殊情况下,使用selenium的api无法操作页面元素,可以考虑通过执行js来完成。 使用方式一(不传参): JavascriptExecutor jse = (JavascriptExecutor) driver; jse.executeScript("..."); 使用方式二(传参): WebElement element = driver.findElemen

  • 参数化2022-04-16 22:00:45

    from time import sleepimport pandas as pdimport pytestfrom selenium import webdriverfrom selenium.webdriver.common.by import Byresult_data = pd.read_excel('wenjian.xlsx',usecols=[0,1])data_res = result_data.values@pytest.mark.parametrize('u

  • 自定义固件2022-04-16 19:31:42

    import pytestfrom selenium import webdriver@pytest.fixture()def test_dakaibaidu(): driver = webdriver.Chrome() yield driver driver.quit()class Test_DK(): def test_baidu(self,test_dakaibaidu): test_dakaibaidu.get("https:///www.baidu

  • 4.复杂操作以及特殊情况处理2022-04-16 19:03:35

    selenium电脑模式和手机模式 # 指定调用某个地方的chrome options = webdriver.ChromeOptions() # chrome浏览器的主程序位置 location = r"F:\All_python_code\scrapy\chrome-win\chrome.exe" # 在options里面增加读取位置为主程序位置 options.binary_location = location drive

  • 5.模拟人类操作采集信息2022-04-16 19:02:33

    拖拽操作 # 拖拽操作 first_target = driver.find_element_by_xpath("//span[contains(text(),'喜羊羊与灰太狼之决战次时代')]") second_target = driver.find_element_by_xpath("//a[contains(text(),'动画')]") action = ActionChains(driver) action.dra

  • 6.Cookie与滑块标签操作2022-04-16 19:02:05

    cookie操作 # 查看cookie cookie = driver.get_cookies() print(cookie) # 增加cookie driver.add_cookie({'name':'xiaoming','key':'9988'}) # 清除所有cookie driver.delete_all_cookies() 拖动滑块操作 # 拖动滑块到10000像素处(顶部w js = "docume

  • 鼠标键盘操作2022-04-16 02:03:14

    鼠标键盘操作   自动化测试时,有些元素不适合直接点击或者进行某些操作时,可以使用Selenium的Actions类来模拟鼠标键盘操作,通过Actions对象可以发起鼠标左键,右键,移动鼠标等操作,最后使用perform方法进行操作。 1、鼠标事件 不带参数的表示针对当前元素操作,带参数的表示针对指定元素

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有