selenium-chromedriver

Cannot connect to Chrome on Selenium / Mountain Lion

丶灬走出姿态 提交于 2019-12-11 16:23:51
问题 I updated my OSX to Mountain Lion yesterday and now my Selenium tests stopped working with Chrome. I re-installed the newest Chromedriver to /usr/local/bin and python selenium from pip. I'm using the stock python 2.7 of mountain lion. This python code used to work: from selenium import webdriver browser = webdriver.Chrome() Now nothing happens. After a while I get the following exception: WebDriverException: Message: u'Unable to either launch or connect to Chrome. Please check that

How to create element's Xpath using different search ( cssSelector / tag / ClassName )

随声附和 提交于 2019-12-11 16:13:48
问题 I would like to find an element using a differect cssSelector / tag / ClassName amd them get it's xpath value ( to be more specific, I have a website where when a day changes, one of the classes change it's class) here is what do I meean: <tr> <td> 1.1.2019 </td> <td> 2.1.2019 </td> <td class="active"> 3.1.2019 </td> <td> 4.1.2019 </td> </tr> <tr> <td> </td> <td> 10 </td> <td> </td> #Here <td> </td> </tr> I want to according to where is that "active class", click the table under it. ny idea

How to automate login credential with selenium chrome web driver

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 16:12:06
问题 I am trying to extract data from the [this][1] website: The manual procedure is to enter String such as 'CCOCCO' in the search box , click on "Predict Properties" and record the 'Glass Transition Temperature (K)' from the table. The following code will automate the above task if the number of html POST is less than 5: from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by

Selenium can't find element even after explicit waiting in an Ajax Page

。_饼干妹妹 提交于 2019-12-11 16:02:48
问题 I'm trying to automate updating fields in a web application. Thus the url does not change after logging in Here is my code so far from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC path_to_chromedriver = "C:/chromedriver" browser = webdriver.Chrome(executable_path=path_to_chromedriver) """Login Page"""

How to switch to iFrame, not working in Selenium

若如初见. 提交于 2019-12-11 15:54:49
问题 I am trying to click on an object within the iframe, but I can't switch frames for some reason. This is the code that I am using to switch frames: driver.switch_to.frame(frame_reference=driver.find_elements_by_xpath('//* [@id="practice_schedule"]')) This is the HTML path: Any solutions? 回答1: .find_elements_by_xpath return list, remove s from it, what you want is .find_element_by_xpath to select first element. 来源: https://stackoverflow.com/questions/53627122/how-to-switch-to-iframe-not-working

Failed-Path Too Long error after downloading csv file using ChromeDriver and Chrome Browser launched by Selenium through cygwin in Python

戏子无情 提交于 2019-12-11 15:36:46
问题 I try to download csv file from the Chrome browser launched by selenium. But Failed- Path too long error happens while downloading csv file. path: C:/s/d/b I change path like below, but same error... /cygdrive/c/s/d/a \cygdrive\c\s\d\a \\cygdrive\\c\\s\\d\\a csv file 20181213171306.csv chromedriver's path /cygdrive/c/Users/HOGEHOGE/chromedriver_2.45.exe Using cygwin, executing python scripts like this below. python3 C:/s/d/a.py I set the web driver option like this below. DIR_DL="C:/s/d/b"

Unable to create new service: ChromeDriverService

馋奶兔 提交于 2019-12-11 15:28:27
问题 I have globally installed Selenium Standalone: npm install selenium-standalone -g selenium-standalone install --singleDriverInstall=chrome I have also bastardised the code from this page into this dotnet core / XUnit test: using System.Threading; using System; using Xunit; using OpenQA.Selenium; using OpenQA.Selenium.Remote; using OpenQA.Selenium.Chrome; using System.Diagnostics; namespace XunitTestLib.Unit { public class BasicBrowserTest : IDisposable { public Process _process; public

Mouse cursor not moving in selenium python even after using pyautogui

丶灬走出姿态 提交于 2019-12-11 15:11:56
问题 Cursor not moving in macbook: Mojave for Chrome browser version: 74.0.3729.169 First tried to use the built in functions ActionChains(self.driver).move_by_offset(300, 400).perform() ChromeDriver version: 74.0.3729.6 Followed the below link to handle cursor movement in mac, chrome. https://automatetheboringstuff.com/chapter18/ Installed all the required software: pip3 install pyobjc-framework-Quartz, pip3 install pyobjc-core, and then pip3 install pyobjc pip3 install pyautogui Tried to debug

Unable to expand selenium WebElement object (/ access its properties) in PyCharm while debugging selenium test

我只是一个虾纸丫 提交于 2019-12-11 15:08:41
问题 I am trying to access value 12345 from span element on a target webpage which looks like this: <span id="[long-dynamically-generated-unique-id]:StaticFixedString"> 12345</span> [long-dynamically-generated-unique-id] is unique id which changes every time I visits the website. So I want to base my selector on :StaticFixedString . I am able to do this as follows: amt = driver.find_element_by_xpath(u"//*[contains(@id, 'StaticFixedString')]") At least, in debug mode, I am able to see amt in

ChromeDriver - Timeout when trying to print page with javascript

血红的双手。 提交于 2019-12-11 14:44:12
问题 I need to save a page as a PDF but I'm having issues. I'm using ChromeDriver and just using google as an example (since my app requires logging in) I navigate to the page (google.com). Then execute window.print() in javascript to get the print window to come up. Chrome opens the print preview page and I get the src of the iframe showing the pdf so I can pull the pdf from the url. My issue is that at the point I execute the javascript it opens the print preview but execution stops there. It's