webdriver

Selenium + WebDriver 各浏览器驱动下载地址

帅比萌擦擦* 提交于 2020-01-24 20:47:14
Chrome 点击下载chrome的webdriver: http://chromedriver.storage.googleapis.com/index.html 不同的Chrome的版本对应的chromedriver.exe 版本也不一样,下载时不要搞错了。如果是最新的Chrome, 下载最新的chromedriver.exe 就可以了。 把chromedriver的路径也加到环境变量里。 Firefox Firefox驱动下载地址为: https://github.com/mozilla/geckodriver/releases/ 根据自己的操作系统下载对应的驱动即可,使用的话,需要把驱动的路径和火狐浏览器的路径加入到环境变量里面才可以 IE IE浏览器驱动下载地址为: http://selenium-release.storage.googleapis.com/index.html 根据自己selenium版本下载对应版本的驱动即可,python的话,下载里面的IEDriverServerxxx.zip即可,这个是区分32和64位系统的,根据自己的系统下载即可,需要注意的是,如果要打开IE浏览器的话,需要在浏览器的Internet选项中的安全页里有4个安全选项,Internet、本地Internet、受信任的站点、受限制的站点,这4个里面都有一个启用保护模式

While fetching all links,Ignore logout link from the loop and continue navigation in selenium java

匆匆过客 提交于 2020-01-24 20:29:56
问题 I am fetching all the links in the page and navigating to all links. In that one of the link is Logout. How do i skip/ignore Logout link from the loop? I want to skip Logout link and proceed List demovar=driver.findElements(By.tagName("a")); System.out.println(demovar.size()); ArrayList<String> hrefs = new ArrayList<String>(); //List for storing all href values for 'a' tag for (WebElement var : demovar) { System.out.println(var.getText()); // used to get text present between the anchor tags

While fetching all links,Ignore logout link from the loop and continue navigation in selenium java

余生颓废 提交于 2020-01-24 20:29:09
问题 I am fetching all the links in the page and navigating to all links. In that one of the link is Logout. How do i skip/ignore Logout link from the loop? I want to skip Logout link and proceed List demovar=driver.findElements(By.tagName("a")); System.out.println(demovar.size()); ArrayList<String> hrefs = new ArrayList<String>(); //List for storing all href values for 'a' tag for (WebElement var : demovar) { System.out.println(var.getText()); // used to get text present between the anchor tags

Python + Selenium firefox webdriver - pulling out images out of a website

自古美人都是妖i 提交于 2020-01-24 15:54:06
问题 I am trying to pull out images from a webpage using: Python 2.7 + Selenium (using FireFox) + Beautiful Soup. The page loads dynamically, hence, I'm using Selenium for screen scraping. Everything looks great on the front end, however, when all the images I loaded, and I look at the HTML, I can't see the links to the images. Any ideas what could be going on here? Site is https://flipp.com/flyers?postal_code=97035 , and from there, navigate to https://flipp.com/weekly_ad/1550082-big-5-sporting

webdriver--设置元素等待

﹥>﹥吖頭↗ 提交于 2020-01-24 14:38:27
sleep():脚本执行到某一位置时“睡一会”,再继续执行;参数的单位是s;sleep方法由python的time模块提供,有两种引入和使用方式 import time time.sleep(5) from time import sleep sleep(5) 在未了解隐式等待这些方式时,sleep方法是我一直用的,有时想看看页面执行到某个位置时的数据显示,或页面跳转后定位新页面的元素等情况,页面执行太快看不到或者定位不到元素,都是通过“睡一会”的方式再继续进行 implicitly_wait():隐式等待,通过一定的时长等待页面上某元素加载完成,若超出时长还未加载出来则抛出NoSuchElementException异常 设置的时间并不是一个固定的等待时间,不影响脚本执行速度; 当脚本执行到某个元素定位时,如果可以定位继续执行; 定位不到时以轮询方式不断判断元素是否定位到,只要时间内定位到就继续执行,不必再等待剩余时长 在超时后,抛出异常       1 driver.get("http://www.zgckxt.com/THome/PC_SelfLearn/Index?id=1056&type=1") 2 driver.find_element_by_xpath(".//*[@id='form1']/div/div/div[3]/div/div[1]/div[2]/div[1]

This version of ChromeDriver has not been tested with Chrome version 79 error running protractorE2E tests with ChromeDriver Chrome Selenium

匆匆过客 提交于 2020-01-24 13:24:26
问题 Those are my settings: .gitlab-ci.yml image: node stages: - test tests: stage: test before_script: # Add Google Chrome to aptitude's (package manager) sources - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list # Fetch Chrome's PGP keys for secure installation - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - # Update aptitude's package sources - apt-get -qq update -y # Install latest Chrome stable, Xvfb packages -

This version of ChromeDriver has not been tested with Chrome version 79 error running protractorE2E tests with ChromeDriver Chrome Selenium

别等时光非礼了梦想. 提交于 2020-01-24 13:24:26
问题 Those are my settings: .gitlab-ci.yml image: node stages: - test tests: stage: test before_script: # Add Google Chrome to aptitude's (package manager) sources - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list # Fetch Chrome's PGP keys for secure installation - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - # Update aptitude's package sources - apt-get -qq update -y # Install latest Chrome stable, Xvfb packages -

Unable to find element with css selector

白昼怎懂夜的黑 提交于 2020-01-24 10:10:46
问题 Using Selenium Webdriver for FF/IE using C# (.Net) Below is my page source and I am trying to use the CssSelector to find/contains the particular name from my page and i have tried with the below code but resulting in error, any help? //code driver.FindElement(By.CssSelector("td:contains('John John')")) //error: e {"Unable to find element with css selector == td:contains('John John')"} System.Exception {OpenQA.Selenium.NoSuchElementException} //my html code: <div id="ctl00_ContentPlaceHolder1

Unable to find element with css selector

 ̄綄美尐妖づ 提交于 2020-01-24 10:10:40
问题 Using Selenium Webdriver for FF/IE using C# (.Net) Below is my page source and I am trying to use the CssSelector to find/contains the particular name from my page and i have tried with the below code but resulting in error, any help? //code driver.FindElement(By.CssSelector("td:contains('John John')")) //error: e {"Unable to find element with css selector == td:contains('John John')"} System.Exception {OpenQA.Selenium.NoSuchElementException} //my html code: <div id="ctl00_ContentPlaceHolder1

Selenium + WebDriver 各浏览器驱动下载地址

你离开我真会死。 提交于 2020-01-23 14:29:42
Chrome 点击下载chrome的webdriver: http://chromedriver.storage.googleapis.com/index.html 不同的Chrome的版本对应的chromedriver.exe 版本也不一样,下载时不要搞错了。如果是最新的Chrome, 下载最新的chromedriver.exe 就可以了。 把chromedriver的路径也加到环境变量里。 Firefox Firefox驱动下载地址为: https://github.com/mozilla/geckodriver/releases/ 根据自己的操作系统下载对应的驱动即可,使用的话,需要把驱动的路径和火狐浏览器的路径加入到环境变量里面才可以 IE IE浏览器驱动下载地址为: http://selenium-release.storage.googleapis.com/index.html 根据自己selenium版本下载对应版本的驱动即可,python的话,下载里面的IEDriverServerxxx.zip即可,这个是区分32和64位系统的,根据自己的系统下载即可,需要注意的是,如果要打开IE浏览器的话,需要在浏览器的Internet选项中的安全页里有4个安全选项,Internet、本地Internet、受信任的站点、受限制的站点,这4个里面都有一个启用保护模式