selenium-chromedriver

Is it possible to set chrome webdriver file as URL?

馋奶兔 提交于 2020-04-14 09:11:32
问题 I have this code to set system properties: System.setProperty("webdriver.chrome.driver", "src\\main\\resources\\driver\\chromedriver.exe"); Is it possible to store chromedriver executable within GitHub and use it in different projects? Something like this: System.setProperty("webdriver.chrome.driver", "https://path_to_file/chromedriver.exe"); 回答1: The open source WebDriverManager may be the closest solution to what you are asking for. WebDriverManager.chromedriver().setup(); WebDriver driver

Is it possible to set chrome webdriver file as URL?

我只是一个虾纸丫 提交于 2020-04-14 09:10:07
问题 I have this code to set system properties: System.setProperty("webdriver.chrome.driver", "src\\main\\resources\\driver\\chromedriver.exe"); Is it possible to store chromedriver executable within GitHub and use it in different projects? Something like this: System.setProperty("webdriver.chrome.driver", "https://path_to_file/chromedriver.exe"); 回答1: The open source WebDriverManager may be the closest solution to what you are asking for. WebDriverManager.chromedriver().setup(); WebDriver driver

WebDriverWait.until - javascript error: Cannot read property 'get' of undefined

我们两清 提交于 2020-04-06 22:11:01
问题 I have a function to access a website and export some Excel file. For that, I import from selenium: from selenium.webdriver.support.ui import WebDriverWait And I call the function every_downloads_chrome inside the 'until' of WebDriverWait . nameFile = WebDriverWait(driver, 120, 1).until(every_downloads_chrome) # method to get the downloaded file name def every_downloads_chrome(driver): if not driver.current_url.startswith("chrome://downloads"): driver.execute_script("window.open('');") driver

WebDriverWait.until - javascript error: Cannot read property 'get' of undefined

半腔热情 提交于 2020-04-06 22:10:25
问题 I have a function to access a website and export some Excel file. For that, I import from selenium: from selenium.webdriver.support.ui import WebDriverWait And I call the function every_downloads_chrome inside the 'until' of WebDriverWait . nameFile = WebDriverWait(driver, 120, 1).until(every_downloads_chrome) # method to get the downloaded file name def every_downloads_chrome(driver): if not driver.current_url.startswith("chrome://downloads"): driver.execute_script("window.open('');") driver

How to initiate a new Chrome session when the default session is already running using ChromeDriver and Chrome through Selenium and Python

你。 提交于 2020-04-06 03:14:09
问题 I am trying to open a web page using the selenium python library with my default user, it is critical that the script uses the default user but if my chrome browser is already open the script crashes and gives me this error: selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir I have tried all the solutions given here : Selenium

How to set paths while scraping data from website

女生的网名这么多〃 提交于 2020-03-26 03:53:26
问题 I am scraping data from this URL. This is my code: from selenium import webdriver import os import time chrome_driver = os.path.abspath(os.path.dirname(__file__)) + '/chromedriver' browser = webdriver.Chrome(chrome_driver) browser.get("https://angel.co/companies?locations[]=1688-United+States") time.sleep(3) data_row = browser.find_elements_by_class_name('base.startup') for item in data_row: print('-'*100) company = item.find_element_by_class_name('name').text location = item.find_element_by

Altair automatic save chart using selenium chromedriver

杀马特。学长 韩版系。学妹 提交于 2020-03-23 08:50:13
问题 Asking this again as the previous has been closed without any useful solution. I am trying to produce few charts in a loop and save them automatically. I am working on Windows, using Chrome. I have been following the documentation on how to save a chart in svg. I downloaded the appropriate ChromeDriver for my Chrome version. gdf is my geodataframe and everything works smoothly and I can generate and manually save charts. Also, this example taken from the chromium documentation works: import

How to set Chrome experimental option same-site-by-default-cookie in python selenium

。_饼干妹妹 提交于 2020-03-23 07:59:08
问题 I suppose this should work: from selenium import webdriver options = webdriver.ChromeOptions() options.add_experimental_option('same-site-by-default-cookies', 'true') driver = webdriver.Chrome(chrome_options=options) to enable samesite cookies restrictions scheduled for future chrome version. It is not, there is error: selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option:

How to fix unknown error: unhandled inspector error: “Cannot find context with specified id”

一曲冷凌霜 提交于 2020-03-23 02:07:56
问题 The following code throws occasionally an org.openqa.selenium.WebDriverException . WebElement element = driver.findElement(by); element.click(); (new WebDriverWait(driver, 4, 100)).until(ExpectedConditions.stalenessOf(element)); The page looks like this (by is a selector for <a></a> ) <iframe name="name"> <html id="frame"> <head> ... </head> <body class="frameA"> <table class="table"> <tbody> <tr> <td id="83"> <a></a> </td> </tr> </tbody> </table> </body> </html> </iframe> The message is

How to fix unknown error: unhandled inspector error: “Cannot find context with specified id”

无人久伴 提交于 2020-03-23 02:06:13
问题 The following code throws occasionally an org.openqa.selenium.WebDriverException . WebElement element = driver.findElement(by); element.click(); (new WebDriverWait(driver, 4, 100)).until(ExpectedConditions.stalenessOf(element)); The page looks like this (by is a selector for <a></a> ) <iframe name="name"> <html id="frame"> <head> ... </head> <body class="frameA"> <table class="table"> <tbody> <tr> <td id="83"> <a></a> </td> </tr> </tbody> </table> </body> </html> </iframe> The message is