selenium-chromedriver

Using Python, Selenium, and BeautifulSoup to scrape for content of a tag?

别说谁变了你拦得住时间么 提交于 2019-12-08 13:27:17
问题 Relatively beginner. There are similar topics to this but I can see how my solution works, I just need help connecting these last few dots. I'd like to scrape follower counts from Instagram without the use of the API. Here's what I have so far: Python 3.7.0 from selenium import webdriver from bs4 import BeautifulSoup driver = webdriver.Chrome() > DevTools listening on ws://....... driver.get("https://www.instagram.com/cocacola") soup = BeautifulSoup(driver.page_source) elements = soup.find

Python, Selenium and Chromedriver - endless loop using find_element_by_id causes CPU problem

房东的猫 提交于 2019-12-08 13:26:54
问题 Good day to all! I've been experiencing this problem for a week now but I don't think I can solve it and I also do not see any solution based on articles online. Hopefully someone can help me here... My scenario: I need to monitor prices from 6 different tables in one page that changes almost every second. By end of day, I would close the browser (by pressing the X button) and terminate the script (by pressing Control+C) then run again in the morning and let it run through out the day. The

Cannot find web elements at “chrome://downloads/” page

陌路散爱 提交于 2019-12-08 13:06:15
问题 I am using Java and Selenium to write tests for Chrome. Sometimes I need to get to chrome://downloads/ and click on CLEAR ALL button. I can get to the page by RemoteWebDriver driver = (RemoteWebDriver) driverChrome; driver.executeScript("window.open();"); Thread.sleep(500); tabs = new ArrayList<String>(driverChrome.getWindowHandles()); driverChrome.switchTo().window(tabs.get(1)); Thread.sleep(500); driverChrome.get("chrome://downloads/"); but I cannot click on the button, whatever xpath I use

chrome webdriver cannot open new tab

给你一囗甜甜゛ 提交于 2019-12-08 12:50:23
问题 I'm trying to open up a new tab in Selenium.WebDriver.ChromeDriver" version="2.21.0.0" but it doesn't open anything, however if I move the debug tracking step back to the line "body.SendKeys(Keys.Control + 't')" to rerun the second time, it works ?? var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30)); IWebElement body = wait.Until(ExpectedConditions.ElementIsVisible(By.TagName("body"))); Thread.Sleep(2000); body.SendKeys(Keys.Control + 't'); Update: It seems to put a stop on chrome

WebDriver: ChromeDriver attempting to reach http://localhost/session on initialization and failing

佐手、 提交于 2019-12-08 12:46:44
问题 The full error message is: Test(s) failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:59662/session timed out after 60 seconds. ----> System.Net.WebException : The operation has timed out The line in my code where this is happening simply instances a new ChromeDriver instance: CurrentDriver = new ChromeDriver(section["chromedriverfolder"]); So my question is... why does a new ChromeDriver invokes the /session URL, and what

c# selenium chrome-webdriver write advanced Path (chrome-driver)

亡梦爱人 提交于 2019-12-08 12:35:28
问题 I just try to write correct path to click exactly this button what I want on my page. I will give you an example page for testing. You just have to download the HTML file and open it in your browser.Code of HTML page What we now want to do? If you run this HTML file you will see all page. And now we want to make a Click on exactly this button on screen : After when you click on this button you will see click counter below: like this : Have anyone idea how to click it? I tried few ways and can

get the following error on selenium

守給你的承諾、 提交于 2019-12-08 11:28:28
问题 I get the following error on selenium, I don't know how to fix it or what I should do, unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"} (Session info: chrome=29.0.1547.57) (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 3 milliseconds Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01' System info: os

Protractor-selenium error message : “gl_surface_egl.cc eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED”

扶醉桌前 提交于 2019-12-08 10:42:17
问题 I am using protractor to test a web application. I have encountered an error message from cmd saying: ERROR : gl_surface_egl.cc(953) eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED I am guessing the error may have raised due to version mismatch of chrome driver. 回答1: This error message... ERROR : gl_surface_egl.cc(953) eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED ...implies that there was an error with GPU decoding . Your main issue is the incompatibility between the

Find and click element based on @onclick w/ Selenium

可紊 提交于 2019-12-08 10:00:47
问题 I am trying to find a element using Selenium in Python that has the html like this: <td class="td1" onclick="window.location.href = 'work_area.php?SID';">Work area</td> Contained in a simple <tr></tr> tag. I have tried using work_area = driver.find_element_by_css_selector('td[contains(@onclick, "work_area.php?SID"]') and using an absolute xpath work_area = driver.find_element_by_xpath("/html/body/table/tbody/tr[2]/td[1]/div/table/tbody/tr[2]/td/table/tbody/tr[3]/td") My buttons structure: +--

WebDriver simulate touch events in Desktop Browser

China☆狼群 提交于 2019-12-08 08:37:14
问题 I'm trying to simulate some touch events like swap, tap in web-based application using Chrome and Firefox browsers. I've tried to simulate touch events with Actions, Hummber.js, "Yahoo" lib(YUI) but none of them works for me. What is the best way to simulate touch events with webdriver in desktop browsers? 回答1: I'm using phantom limb which transforms mouse events to touch events. It worked for me. I thing the best way to simulate touch events in Chrome is to use built-in emulations mechanism.