webdriver

Python Selenium - How to loop to the last <li> element in a site

◇◆丶佛笑我妖孽 提交于 2020-01-30 13:03:06
问题 I have created a python selenium script that should navigate through a website and collect people profiles (https://www.shearman.com/people). The program won't loop through the pages to collect the links. I have used this which doesn't work; try: # this is navigate to next page driver.find_element_by_xpath('//div[@id="searchResultsSection"]/ul/li[12]').click() time.sleep(1) except NoSuchElementException: break The syntax behind the next button can be seen below; <a href="" onclick=

Selenium invisibilityOf(element) method throwing NoSuchElementException + WebDriverWait.ignoring(NoSuchElementException.class) is not working

◇◆丶佛笑我妖孽 提交于 2020-01-30 11:42:44
问题 This query consists of 2 related questions. I need to wait for an element to be invisible before I go to next step, hence I tried to define a custom method as below: public void waitToDisappear(long timeOutInSeconds, WebElement element) { WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds); wait.ignoring(org.openqa.selenium.NoSuchElementException.class); wait.until(ExpectedConditions.invisibilityOf(element)); } When I call this method as common.waitToDisappear(5, <WebElement>); ,

Selenium invisibilityOf(element) method throwing NoSuchElementException + WebDriverWait.ignoring(NoSuchElementException.class) is not working

北城以北 提交于 2020-01-30 11:41:10
问题 This query consists of 2 related questions. I need to wait for an element to be invisible before I go to next step, hence I tried to define a custom method as below: public void waitToDisappear(long timeOutInSeconds, WebElement element) { WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds); wait.ignoring(org.openqa.selenium.NoSuchElementException.class); wait.until(ExpectedConditions.invisibilityOf(element)); } When I call this method as common.waitToDisappear(5, <WebElement>); ,

Python - which is considered better for scrapping: selenium or beautifulsoup with selenium? [closed]

天大地大妈咪最大 提交于 2020-01-30 11:01:46
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . This question is for Python 3.6.3, bs4 and Selenium 3.8 on Win10. I am trying to scrape pages with dynamic content. What I am trying to scrape is numbers and text (from http://www.oddsportal.com for example). From my understanding using requests+beautifulsoup will not do the

selenium.common.exceptions.WebDriverException: Message: unknown error: Failed to create a Chrome process with ChromeDriver Chrome with Selenium Python

孤者浪人 提交于 2020-01-30 11:01:37
问题 I am trying to click a button using selenium so I made it find the element with the xpath since i couldn't find the id . EDIT: I didn't think the rest of the code had anything to do with it but i added it just in case This is The Code import requests import os import selenium from selenium import webdriver os.system("cls") print(" ") print("______________ _____________ ________________") print("| | | | | | | | |______________|") print("| |________ // | | __ | | | |") print("| |________ \\\\ |

'UnknownError',message: 'An unknown server-side error occurred while processing the command.',orgStatusMessage: 'connection refused with webdriver.io

╄→尐↘猪︶ㄣ 提交于 2020-01-30 09:20:06
问题 I am following this guide: http://webdriver.io/guide.html and firefox version I am using 62.0 I followed following steps: I downloaded latest selenium-standalone-server version 3.14. I have downloaded latest gecko driver version 0.22.0 and extracted it in project folder Ran selenium standalone version using command java -jar -Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.5.3.jar Then run the command npm install webdriverio Created a test file test.js with code var

How to resolve org.openqa.selenium.ElementNotVisibleException using Selenium with Java in Amazon Sign In

杀马特。学长 韩版系。学妹 提交于 2020-01-30 09:04:34
问题 package newpackage; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; public class OpenAmazon { public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\chromedriver_win32\\chromedriver.exe"); driver=new

Exception in thread “main” java.lang.NullPointerException using WebDriver Driver=new Chrome() and maximize Chrome browser window using selenium script

独自空忆成欢 提交于 2020-01-30 08:19:06
问题 How to maximize Chrome browser window using selenium script? This is my code: package newpackage; import org.openqa.selenium.WebDriver; public class MyClass { public static void main(String[] args) { WebDriver Driver=new Chrome(); Driver.get("http://www.google.com"); Driver.manage().window().maximize(); } } However, I get this error: Exception in thread "main" java.lang.NullPointerException at newpackage.MyClass.main(MyClass.java:10) 回答1: To work with Selenium 3.4.0 you need to download the

Chrome Automation Extension has crashed

孤街醉人 提交于 2020-01-30 08:17:39
问题 I am using Selenium in C# to automate against Google Chrome. I am using the latest version of Chrome (78.0.3904.70) , Selenium.Webdriver (3.141.0) , and Selenium.Chrome.Webdriver (77.0.0) . I use: ChromeDriver chrome = new ChromeDriver(); . Chrome opens, but does not load correctly, like in the image below, and I am unable to use any Selenium features. What do I need to change to use Chromedriver? I downloaded ChromeDriver v.78 and have referenced it with new ChromeDriver(v78 path) , and it

Chrome Automation Extension has crashed

我只是一个虾纸丫 提交于 2020-01-30 08:16:47
问题 I am using Selenium in C# to automate against Google Chrome. I am using the latest version of Chrome (78.0.3904.70) , Selenium.Webdriver (3.141.0) , and Selenium.Chrome.Webdriver (77.0.0) . I use: ChromeDriver chrome = new ChromeDriver(); . Chrome opens, but does not load correctly, like in the image below, and I am unable to use any Selenium features. What do I need to change to use Chromedriver? I downloaded ChromeDriver v.78 and have referenced it with new ChromeDriver(v78 path) , and it