selenium-chromedriver

ChromeDriver has started to create blank screenshots?

送分小仙女□ 提交于 2019-12-11 06:44:45
问题 I am using ChromeDriver to create automated browser tests. This stopped working today, taking a look at the screenshots that are saved in the database, they are all blank pixels. Why? Version ChromeDriver 2.29.0 Screenshot Hexdump Code (c#) foreach (var testStep in testSteps.ToList()) { var testStepRun = new TestStepRun(); repo.createTestStepRun(testStepRun); /* I omit this function in my posting but will include it if needed */ RunTestStep(testStep); try { testStepRun.ScreenshotPNG = driver

WebDriverException when starting chromedriver with user-data-dir argument

℡╲_俬逩灬. 提交于 2019-12-11 06:38:01
问题 My code: from selenium.webdriver.chrome.options import Options from selenium import webdriver opts = Options() opts.add_argument("user-data-dir=/path/to/profiles_dir/user_id") browser = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver", chrome_options=opts) When I start Chromium for user with id = 1 it starts fine and creates a profile directory /path/to/profiles_dir/1. Then I visit some arbitrary site and close the browser. When I execute the above code for the second time, it throws

Get WebDriver of already opened Chrome Browser

醉酒当歌 提交于 2019-12-11 06:26:40
问题 I would like to have a IWebDriver of an already opened browser like Chrome. Because then I need to automate a form authentication and/or a basic authentication. I thought that this IWebDriver driver = new RemoteWebDriver(new System.Uri("http://localhost:4445/wd/hub"), new ChromeOptions()); would do the trick but it only opens another chrome window. Instead I would like to "read" an already opened one. Is it possible with selenium? O r should I use another library? 回答1: As per the Selenium

Web scrapping using selenium and beautifulsoup.. trouble in parsing and selecting button

﹥>﹥吖頭↗ 提交于 2019-12-11 06:20:53
问题 I am trying to web srape the following website "url='https://angel.co/life-sciences' ". The website contains more than 8000 data. From this page I need the information like company name and link, joined date and followers. Before that I need to sort the followers column by clicking the button. then load more information by clicking more hidden button. The page is clickable (more hidden) content at the max 20 times, after that it doesn't load more information. But I can take only top follower

ChromeOptions to set browser zoom to 80%

左心房为你撑大大i 提交于 2019-12-11 06:05:55
问题 I would like to set the default zoom value to 80% when opening the browser for a selenium framework. Something along the lines of below. Is this possible with ChromeOptions. private static ChromeOptions GetChromeOptions() { ChromeOptions options = new ChromeOptions(); options.AddArgument("--start-maximized"); options.AddArgument("Zoom 80%"); return options; } 回答1: To to set the zoom level to 80% you can use Javascriptexecutor with either of the following options : ((IJavaScriptExecutor)driver

Python Selenium with ChromeDriver Headless: Fails To Start— “DevTools request failed”

拜拜、爱过 提交于 2019-12-11 06:04:44
问题 I've got this running on my Macbook Pro, so in an attempt to transfer it to my server for prolonged use, I have run into a snag. Server is Ubuntu 16.04 (server) and Python 2.7.12. I installed the latest version of selenium using pip, and the latest version of ChromeDriver. I can start it fine from the command line (there is a GPU error but it seems not to cause any problems.) However, when I try to start it from within python, using this code: from selenium import webdriver from selenium

How to enable PhantomJS WebDriver in Selenium?

≯℡__Kan透↙ 提交于 2019-12-11 05:52:00
问题 I need to rewrite my Java program from ChromeDriver to PhantomJS. I think i should just enable PhantomJS instead of ChromeDriver and nothing more (am i right?). I tried a few ways to do this, but i always get NoClassDefFoundError. My way of enabling ChromeDriver: System.setProperty("webdriver.chrome.driver", CHROMEDRIVER_PATH); WebDriver driver = new ChromeDriver(); And this is how i tried to enable PhantomJS: DesiredCapabilities DesireCaps = new DesiredCapabilities(); DesireCaps

Xpath is correct still get no such element: Unable to locate element

不羁的心 提交于 2019-12-11 05:38:23
问题 My Xpath is correct & no iFrame and I can locate element in Chrome console but my program still fails. I have used explicit wait also. website http://newtours.demoaut.com/ I am trying to locate login page and send login id. Error message: PASSED: openURL FAILED: loginToTours **org.openqa.selenium.NoSuchElementException**: **no such element: Unable to locate element: {"method":"xpath","selector":"//input[@name='userName']"}** *** Element info: {Using=xpath, value=//input[@name='userName']}

Uploading a file with Selenium C#

随声附和 提交于 2019-12-11 05:27:14
问题 I'm having a problem managing File upload in Selenium using Chromedriver and C# . I read a couple of answers to similiar problems regarding the file uploader dialogue window and how this can be solved. The thing is that I don't have the standard input element but instead, I have this: <div class="scUploadWrapper"> <div id="Overlay2" class="scUploadOverlay" style="width: 80px; height: 59px;"> <embed id="yuigen1" type="application/x-shockwave-flash" src="..." style="undefined" name="yuigen1"

Creating a page count down in Python Selenium

岁酱吖の 提交于 2019-12-11 05:25:13
问题 I have a simple script that navigates to a series of pages. My question is, how do I create a page counter so I know where the job is at for this? Ideally it would read: Page 5 Page 4 #For each loop The following tends to work, though I am having issues with the following: elements = [x.get_text() for x in wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,'(//div[div/div/text()="Main Lists"]//div[starts-with(@class, "sm-CouponLink_Label") and normalize-space()]')))] Related error: