selenium-chromedriver

Chromedriver on Ubuntu: selenium.common.exceptions.SessionNotCreatedException: Message: session not created

萝らか妹 提交于 2019-12-13 03:38:29
问题 Having trouble with selenium + chromedriver in the ubuntu environment in AWS (EC2 instance). I'm using chromedriver Linux64 version ( wnload chromedriver for Linux: wget https://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.zip ). I've then placed chromedriver in /usr/bin . Chrome was downloaded for ubuntu using sudo dpkg -i google-chrome-stable_current_amd64.deb If I verify the version of chrome using google-chrome --version i see that it's: Google Chrome 78.0.3904.70

Changing a looping string inside for loop

不羁岁月 提交于 2019-12-13 03:37:30
问题 This is a follow up question to my previous problem driver = webdriver.Chrome(executable_path="C:/Users/Joonas/PycharmProjects/Dictionaries/chromedriver.exe") driver.get("http://naturalstattrick.com/games.php") driver.minimize_window() away_team = driver.find_element_by_xpath("//*[@id='teams_wrapper']/div[2]/div[3]/div[2]/div/table/tbody/tr[1]/td[2]") #Arizona home_team = driver.find_element_by_xpath("//*[@id='teams_wrapper']/div[2]/div[3]/div[2]/div/table/tbody/tr[2]/td[2]") #Vegas print

How do I make my web scraping script more robust?

戏子无情 提交于 2019-12-13 03:23:26
问题 I launched a code to scrap the Santander website. Scraping seems to work, except that I get false results. And when I run the code twice in a row, the results change. How could I make the scraping more robust, the problem is that when I run the code and check the results one by one, it seems to work well. def hw_santander_scrap(Amount, Duration): from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as

Open chrome browser with Selenium in VBA

依然范特西╮ 提交于 2019-12-13 03:08:12
问题 I've downloaded Selenium to automate some web browsing in VBA, and as excited as I am to use it, I cannot seem to get it up and running. I'm trying to open up a chrome browser to start navigating to pages and doing what I need to do but every time it opens up to a blank page with URL "data:," and I get an error "WebRequestError The underlying connection was closed: An unexpected error occured on a receive." I've seen several tips for this type of thing searching around but in trying to

selenium.common.exceptions.WebDriverException: Message: invalid argument: value must be a non-negative integer with ChromeDriver and Selenium

人盡茶涼 提交于 2019-12-13 02:55:34
问题 I am working on selenium (3.5.0),Python 3.6.8 i wanted to test simple code that is written below driver.implicitly_wait(10) driver.get(url) print(driver.title) sleep(6) driver.close() but it is throwing an error i.e selenium.common.exceptions.WebDriverException: Message: invalid argument: value must be a non-negative integer I am not getting where i went wrong I found similar issue raised by someone in this platform but my problem didn't get solved please help me in this regard 回答1: This

Can't use proxy within selenium vba script

允我心安 提交于 2019-12-13 02:47:09
问题 I've written a script in vba in combination with selenium . The script does it's jobs just fine if I comment out the line I may have wrongly defined for proxy . How can I run my scraper using proxy ? I searched a lot but could not find a match that could help me solve this. This is my try: Sub UseProxy() Dim driver As New ChromeDriver, post As Object With driver .setProxy "38.131.10.78:53281" .get "https://stackoverflow.com/questions/tagged/web-scraping" For Each post In .FindElementsByCss("

Install/Add chrome extension from Chrome Web Store using Selenium

跟風遠走 提交于 2019-12-13 02:36:31
问题 I am developing test automation using Selenium with Java. I would like to install/add extension to chrome instance launched through Selenium. One way to install/add extension is using .crx file as follow. ChromeOptions options = new ChromeOptions(); options.addExtensions(new File(ext_path)); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, options); driver = new ChromeDriver(capabilities); But I would like to install/add

unknown error: failed to write prefs file for loading multiple chrome profile

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:18:00
问题 I have difficult time trying to load multiple chrome profile at the same time, and it always show "unknown error: failed to write prefs file" .I'm using selenium 2.48.2 and Selenium.WebDriver.ChromeDriver 2.20.0.0 string localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); String chromeLocalAppDataPath = localAppDataPath + @"\Google\Chrome\User Data\Default\"; var options = new ChromeOptions(); options.AddArgument("--no-experiments"); options

Select a dropdown using Python + Selenium

ⅰ亾dé卋堺 提交于 2019-12-13 01:34:47
问题 I am writing an automation for work and am stuck with a dropdown. The particular select box in question is as follows: <span class="a-dropdown-container" id="select-size-bulk-asin"> <select name="display_type" class="a-native-dropdown"> <option value="SMALL-IMAGES">SMALL-IMAGES</option> <option value="LARGE-IMAGES">LARGE-IMAGES</option> <option value="TEXT">TEXT</option> </select> <span tabindex="-1" data-a-class="a-spacing-small" class="a-button a-button-dropdown a-spacing-small"> <span

How to get browser network logs using python selenium

萝らか妹 提交于 2019-12-13 00:55:50
问题 I'm trying to get browser network logs using selenium to debug request/responses. Could you please help me to find out a way. And I'm using selenium 3.14.0 and latest Chrome browser. 回答1: Using Python and ChromeDriver To get network logs, you need to install BrowserMobProxy as well along with selenium in python pip install browsermob-proxy You need to start browser proxy and configure the proxy in chrome option of chrome driver, from browsermobproxy import Server from selenium import