selenium-webdriver

How can I host a backend service powered by web scraping using selenium web driver?

时光怂恿深爱的人放手 提交于 2021-01-28 18:15:54
问题 So I am developing a project to scrape a website and deliver data to users, however I am using selenium/selenium web driver with python/flask. I was originally going to use beautifulsoup, but the website I am scraping requires some interactions on the page. I have everything working with the scraper, I am just trying to figure out a way to make this work universally if I wanted to host this service on a website using a service such as heroku. Currently Selenium is opening a chrome browser and

How can I host a backend service powered by web scraping using selenium web driver?

时光总嘲笑我的痴心妄想 提交于 2021-01-28 18:07:56
问题 So I am developing a project to scrape a website and deliver data to users, however I am using selenium/selenium web driver with python/flask. I was originally going to use beautifulsoup, but the website I am scraping requires some interactions on the page. I have everything working with the scraper, I am just trying to figure out a way to make this work universally if I wanted to host this service on a website using a service such as heroku. Currently Selenium is opening a chrome browser and

Cannot switch to new window using Selenium Webdriver using switchTo()

随声附和 提交于 2021-01-28 14:41:56
问题 I have searched and searched for an answer to this question. I am testing in IE8 using Selenium Webdriver and C#. At a certain point in the test I am required to click a button that will then open up a new application window with forms that need to be filled out to continue the test. I have tried: driver.switchTo().Window(driver.WindowHandles[0]); driver.switchTo().Window(driver.WindowHandles[1]); //this one usually returns and error driver.switchTo().Window(driver.WindowHandles.Last()); I

Why isn't the 'chromedriver' executable in the PATH even after using ChromeDriverManager through Selenium and Python

偶尔善良 提交于 2021-01-28 13:32:13
问题 I'm trying to click the "Launch Earth" button with this block of code. from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Web from selenium.webdriver.support import expected_conditions as EC url = 'https://www.google.com/earth/' driver = webdriver.chrome() driver.get(url) wait = WebDriverWait(driver, 10)

Selenium's find_elements with two clauses for text?

本小妞迷上赌 提交于 2021-01-28 12:14:04
问题 How can I use selenium's find_elements_by_xpath() based on text, when it may or may not have a word? Example: it can be either #1 here or #1 is here . I want both to be part of the same list, since that func return a list. ATM I have driver.find_elements_by_xpath("//*[contains(text(), '#1 here')]") but that would only find the first case, not the ones with an is . Basically, something like driver.find_elements_by_xpath("//*[contains(text(), '#1 here' or '#1 is here')]") How could I do that? I

WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) with GeckoDriver Firefox and Selenium Java

旧时模样 提交于 2021-01-28 11:41:54
问题 Using Selenium 3.1.0, firefox latest version 72.0, default firefox driver 2.53.1 here is my code System.setProperty("webdriver.gecko.driver" ,"C:\\Users\\sindhusha.tummala\\Downloads\\geckodriver.exe"); driver = new FirefoxDriver(); Still i am getting the error org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; Could any one help with this 回答1: This error message... org.openqa.selenium

Unable to locate element under dynamic-comp

独自空忆成欢 提交于 2021-01-28 09:22:58
问题 There are dozens of questions here on SO with a title very similar to this one - but most of them seem related to some iFrame, which prevents Selenium to access the intended tag, node, or whatever. In my case, I'm trying to access this site. All I want is to read the data on a table - it is easy to identify, given there it is inside a div with a very particular ID. The table is also simple to read. Despite that, there is this dynamic-comp tag, which seems to be my stumbling block - I can

How to select 2nd Level SubMenu in Selenium WebDriver with Java

萝らか妹 提交于 2021-01-28 09:22:40
问题 I have been trying all possible answers that were provided for similar Query. My lay-out Structure of the Menu: MainMenu1 , Manimenu2.... etc Under Each Mainmenu Submenu1>Item1, Item2, Item3 Submenu2>Item1, Item2, Item3 Submenu3>Item1, Item2, Item3 To get to Item1 or Item2 or Item3, we have to move the mouse over and hover it over Mainmenu1>submenu1 and then click Item2 I was able to use mouse-hover command and get it open the Mainmenu but unable to get past it. Any suggestions Please?

System.InvalidOperationException : Error forwarding the new session cannot find : Capabilities {browserName: chrome, marionette: false}

蹲街弑〆低调 提交于 2021-01-28 09:06:25
问题 I am trying to run my Selenium C# automated test using Grid . When i run the test I get the error: Message: System.InvalidOperationException : Error forwarding the new session cannot find : Capabilities {browserName: chrome, marionette: false, platform: WINDOWS} I have chromedriver.exe in the following directory: F:\Selenium Projects\C#\Grid practice\automation\ I have set the path for Environment Variables from System, Control Panel to the path: F:\Selenium Projects\C#\Grid practice

How to retrieve a sub-string from a string that changes dynamically with respect to multiple delimiters through Selenium in Python

谁说我不能喝 提交于 2021-01-28 08:50:43
问题 I wonder if its possible to remove part of the scraped string like: Wujek Drew / Uncle Drew into Uncle Drew Of course, as it is web scraping, the titles will be different every time, so what can I do here to get the result above? Update I forgot to add something that need to be removed also. Wujek Drew / Uncle Drew (2018) I Will need to delete the data at the end of the string. 回答1: To remove first part of the scraped string separated by / character you can use the following solution: value =