selenium-chromedriver

Python + Selenium: Path to driver

天涯浪子 提交于 2019-12-24 14:36:59
问题 Is there any possibility to run Python + Selenium script without entering the path of an exe file in every single script in Python line: driver = webdriver.Chrome(). The same question applies to "IE Driver", "Edge Driver" and "Gecko Driver". Can it be done by some general python class and should I create some additional file for it? Or is it a matter of Integrated Development Environment configuration? I would be grateful for your expert word. 回答1: You can change the source code. Just assign

How to test multiple version of google chrome using chromedriver?

无人久伴 提交于 2019-12-24 14:34:46
问题 selenium web-driver with java then how to use chrome driver for test their lower version of Google chrome 回答1: From the official wiki page: Overriding the Chrome binary location You can specify the location of the Chrome binary by passing the "chrome.binary" capability, e.g. with a typical Chromium install on Debian: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability("chrome.binary", "/usr/lib/chromium-browser/chromium-browser"); WebDriver driver = new

Why .sendKeys(Keys.chord(Keys.CONTROL, “a”)) does not work in Chrome

江枫思渺然 提交于 2019-12-24 13:24:50
问题 I am trying to select text in the text field and delete it. I use chromedriver for linux. This is my code: loginPage.getPasswordField().sendKeys(Keys.chord(Keys.CONTROL, "a")); loginPage.getPasswordField().sendKeys(Keys.DELETE); But it does not work (actually first line). Why? How to make it work? Versions: Chrome: Version 28.0.1500.95 ChromeDriver: chromedriver_linux64_2.1/chromedriver_linux64_2.2 回答1: Have you tried to use action builder? For example, from our automation suite: public void

TypeError: 'NoneType' object is not subscriptable while invoking execute_script() for Chrome Download Manager through Selenium

假装没事ソ 提交于 2019-12-24 12:19:56
问题 I have been using this function https://stackoverflow.com/a/48267887/11220889 for waiting for downloads to finish and returning the file path once finished. And it has been working great until now. The Function def every_downloads_chrome(driver): if not driver.current_url.startswith("chrome://downloads"): driver.get("chrome://downloads/") return driver.execute_script(''' var items = downloads.Manager.get().items_; if (items.every(e => e.state === "COMPLETE")) return items.map(e => e.file_url)

Docker Selenium: selenium.common.exceptions.WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127

为君一笑 提交于 2019-12-24 11:46:10
问题 I am using selenium's chromedriver in my python project. I am building successfully my Dockerfile: FROM ubuntu:17.04 FROM selenium/standalone-chrome FROM python:3.6 RUN apt update RUN apt-get install -y libnss3 libgconf-2-4 ADD ./requirements.txt /tmp/requirements.txt RUN python -m pip install -r /tmp/requirements.txt ADD . /opt/example1/ # rights? RUN chmod +x /opt/example1/assets/chromedriver WORKDIR /opt/example1 CMD ["python","-u","program.py"] But when I run my docker container I got

Chrome is allowing insecure pages via WebDriver

我的梦境 提交于 2019-12-24 11:37:35
问题 Using Chrome 62 with Chrome Driver 2.33 and WebDriver 3.6.0, Chrome allows pages to load with bad SSL certificates -- it says "Not Secure" in the URL bar when the page opens, but the page is loaded none-the-less. If I access the page manually, then I get the expected 'blocker page'. However, I want Chrome to reject the page via WebDriver just like Chrome does to human users. Unfortunately I cannot find anyone else reporting this same problem (just lots of people reporting the exact opposite

Chrome version must be between 71 and 75 error after updating to ChromeDriver 2.46

大城市里の小女人 提交于 2019-12-24 11:29:53
问题 After update of chromedriver to version 2.46 my tasts fail to initialize. I got message like this: Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 44269 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. Failed to invoke configuration method com.personal.CustomTest.initTests not created: Chrome version must be between 71 and 75 (Driver info: chromedriver=2.46.628402

Selenium does not download with options passed to the Chrome driver

て烟熏妆下的殇ゞ 提交于 2019-12-24 10:49:53
问题 I want to download a file and I am able to do it with the code below. When I pass options to the driver, download does not start. from selenium import webdriver url = "http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/CCARCS-RIACC/DDZip.aspx" driver.get(url) driver.find_element_by_id("btnDownload").click() I tried to pass following options, but download does not start: from selenium import webdriver url = "http://wwwapps.tc.gc.ca/Saf-Sec-Sur/2/CCARCS-RIACC/DDZip.aspx" options = webdriver.ChromeOptions()

Refused to load the script because it violates the following Content Security Policy directive: script-src error with ChromeDriver Chrome and Selenium

我与影子孤独终老i 提交于 2019-12-24 10:44:17
问题 I am trying to scrape Phone Number from these links "https://www.practo.com/delhi/doctor/dr-meeka-gulati-dentist-3?specialization=Dentist&practice_id=722421" and "https://www.practo.com/delhi/doctor/dr-rajeev-puri-ear-nose-throat-ent-specialist?specialization=Ear-Nose-Throat%20(ENT)%20Specialist&practice_id=912154" if element present it scrapes the phone number otherwise phone number is None Spider Code: from selenium import webdriver from selenium.webdriver.common.by import By from selenium

ChromeDriver hanging sporadically, DevTools request failed. Chrome not reachable error

自闭症网瘾萝莉.ら 提交于 2019-12-24 10:35:04
问题 Tests fail sporadically with the error of "Chrome not reachable". Throwing a WebDriver exception: chrome not reachable (Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.26 seconds Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z' System info: host: 'XXXXXXXX', ip: 'XXXXXXXXX', os.name: