selenium-chromedriver

can't get xpath to click on pop up in selenium

我们两清 提交于 2019-12-06 16:11:27
I'm trying to extract a few simple CIK codes from the SEC. If you run the code below, you will get a pop about a "survey". if you do it manually, you won't see it. it bombs my code. but since it is in selenium, I can't inspect it with chropath to get the xpath to click on the "NO". And I can't recreate the pop up in a normal browser. What do i do? from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium import webdriver from selenium.webdriver.common.keys import Keys

Web scrapping with a double loop with selenium and using By.SELECTOR

筅森魡賤 提交于 2019-12-06 15:15:05
I am trying to get the pdf files from this website. I am trying to create a double loop so I can scroll over the years (Season) to get all the main pdf located in each year. The line of code is not working is this one. The problem is, I can not make this line work (The one that is supposed to loop all over the years (Season) : for year in wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, "#season a aria-valuetext"))): year.click() This is the full code: os.chdir("C:..") driver = webdriver.Chrome("chromedriver.exe") wait = WebDriverWait(driver, 10) driver.get("http://www.motogp

Why Selenium always create temporary Firefox Profiles using Web Driver?

最后都变了- 提交于 2019-12-06 14:55:43
Why Selenium always create temporary Firefox Profiles using Web Driver though I told it to use a existing one ? According to this answer it is not possible to stop Selenium from creating temporary Firefox Profiles using Web Driver. But with chromedriver I can achieve this. So why it is different for Firefox. I checked the FirefoxProfile.cs of Selenium repo and found the following code snipet is used to copy profile--- public void WriteToDisk() { this.profileDir = GenerateProfileDirectoryName(); if (!string.IsNullOrEmpty(this.sourceProfileDir)) { FileUtilities.CopyDirectory(this

Opening Chrome browser in Android device using Robot Framework script and chromedriver?

半腔热情 提交于 2019-12-06 14:16:13
问题 Automation setup on Ubuntu 14.04: Robot Framework 2.9.2 (Python 2.7.6 on linux2) selenium2library-1.7.4 ChromeDriver 2.20.353124 Device under testing: Nexus 7 (KitKat 4.4, Chrome v. 47) Everything works fine when running this following example test with Python --> URL is launched properly on Chrome in Nexus device. from selenium import webdriver capabilities = { 'chromeOptions': { 'androidPackage': 'com.android.chrome', } } driver = webdriver.Remote('http://localhost:9515', capabilities)

How to update Chromedriver on Ubuntu?

风格不统一 提交于 2019-12-06 13:35:41
I want to update Chromedriver to the latest version. How can I do this on the command line? Download chromedriver from https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip Unzip it and put it in location /usr/bin/chromedriver and change its permission to 755 using chmod. This will download the latest version, and install it to the correct location, with the correct permissions. version=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE) wget -qP "/tmp/" "https://chromedriver.storage.googleapis.com/${version}/chromedriver_linux64.zip" sudo unzip -o /tmp

How to set browser window size for Chrome and Opera launched by Selenium WebDriver in incognito/private mode?

自作多情 提交于 2019-12-06 13:30:14
I'm working on application which will execute tests on multiple browser types (Chrome, FireFox, Internet Explorer and Opera). I found the way how to launched them in incognito/private modes ( How to open incognito/private window with Selenium WD for different browser types? ) and set window size ( Browser window control #174 ): Window window = driver.manage().window(); window.setPosition(new Point(0, 0)); window.setSize(new Dimension(width, height)); But this code does not work in all cases: +-------------------+----------+-------------------+ | Browser | Standard | Incognito/Private | |------

Selenium WebDriverWait but still “Element is not clickable at point”

时光总嘲笑我的痴心妄想 提交于 2019-12-06 13:01:10
问题 I have the following code (br is the webdriver and everything is imported fine). The first 3 lines work fine but the link1.click() still gives me an error: link = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "buttonNew Project"))) link.click() link1 = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "MP"))) link1.click() And even though it should have waited until its clickable, I still get the the error: WebDriverException: unknown error: Element is not

org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities

旧时模样 提交于 2019-12-06 12:58:55
Hub starting command : java -jar selenium-server-standalone-3.11.0.jar -role hub Node starting command : java -Dwebdriver.chrome.driver=/Users/alina/Selenium/chromedriver.exe -jar selenium-server-standalone-3.11.0.jar -role webdriver -hub http://192.168.100.4:4444/grid/register/ Environment Details (updated from comments) : Selenium 3.11.0, Chrome 66, ChromeDriver 2.38 import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriver; import org.openqa

Selenium with chromedriver gives different results based on “headless” argument

☆樱花仙子☆ 提交于 2019-12-06 12:37:53
I have been playing around with Selenium + Chromedriver and I noticed I get different results based on if headless is enabled or disabled. After some investigation I found out that "headless" does not include the Accept-Language header. Is there anyway to manually add this in the headers? DrStrangelove That's what Google chrome does. One way around it would be to use a proxy and modify the headers for you. Or you can use the Firefox driver as that driver does not send different headers when using the headless option. Ideally, using and not using the --headless option shouldn't have any major

How to close all the windows before the next test in a test suite?

别来无恙 提交于 2019-12-06 12:29:30
[7] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> page.execute_script "window.close()" Selenium::WebDriver::Error::NoSuchWindowError: Script execution failed. Script: window.close(); The window could not be found [8] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> page.driver.browser.window_handles => ["f1-2"] I had a browser open with two tabs, the above command does close one but the last tab never closes. It is open but when I try to run page.execute_script "window.close()" it gives the above error. page.driver.browser.window_handles.each do |handle| page.driver.browser.switch_to.window(handle)