selenium-chromedriver

How to enable cookies in Chromedriver with Webdriver?

时光怂恿深爱的人放手 提交于 2019-12-19 19:52:50
问题 I am trying to use Selenium's Chromedriver to log in to a website which has cookies enabled. I got a message from the server that the browser has cookies disabled. How can I enable cookies in Chromedriver? 回答1: ChromeDriver has cookie be enabled by default. Please try the following steps: Use FirefoxDriver/IEDriver, see what the site says. Manually open a Chrome browser, see what the site says. Try open whatismybrowser.com with ChromeDriver opened browser, see what it tells you. If your site

Selenium ChromeDriver: unable to set user-data-dir

血红的双手。 提交于 2019-12-19 13:45:30
问题 I'm setting the user director to be my default User data directory as such (so I don't have to worry about entering passwords to sites and logging in each time): from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("--user-data-dir=~/Library/Application\ Support/Google/Chrome/Default/") browser = webdriver.Chrome(options=options, executable_path=r"chromedriver") browser.get('https://mail.google.com/mail/u/0/') print browser.desired_capabilities Now I would

import cannot be resolved for selenium drivers

爱⌒轻易说出口 提交于 2019-12-19 11:54:12
问题 I am trying to import WebDriver & ChromeDriver, tried all libraires but no luck import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class TestChrome { public static void main(String[] args) { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver", "/home/vikas/Downloads/chromedriver.exe"); // Initialize browser WebDriver driver=new ChromeDriver(); // Open Google driver.get("http://www.google.com"); // Maximize browser driver

How to switch tabs on Chrome in Selenium C#?

萝らか妹 提交于 2019-12-19 11:28:32
问题 I am using: Chrome 55.0.2 Selenium WebDriver 3.0.1 with ChromeDriver C# 4.6.1 (VS2015 Community Edition) I am writing automation code that opens Chrome, opens a tab, and navigates to a main page URL. This main page has information that I parse to generate a secondary page URL. My issue is that I cannot write code that will switch back to the main page tab after the secondary page loads, nor can I write code that never leaves the main page. I will explain the two options I am pursuing: Option

Running Chromedriver on Ubuntu Server headlessly

Deadly 提交于 2019-12-19 10:11:48
问题 I am using Selenium with Chromedriver in Java (1.8) to do some automated web crawling: System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("someurl.com"); I am attempting to migrate to an Ubuntu 16.04 Server. On the server I have installed the Ubuntu chromedriver version 2.37, chrome version 65. According to the chromedriver documentation these versions are compatible. I have changed the code specifying the location of the

Running Chromedriver on Ubuntu Server headlessly

夙愿已清 提交于 2019-12-19 10:10:08
问题 I am using Selenium with Chromedriver in Java (1.8) to do some automated web crawling: System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("someurl.com"); I am attempting to migrate to an Ubuntu 16.04 Server. On the server I have installed the Ubuntu chromedriver version 2.37, chrome version 65. According to the chromedriver documentation these versions are compatible. I have changed the code specifying the location of the

ChromeDriver 76.0.3809.68 is throwing exception with SelectByVisibleText method: Script returns unexpected result

寵の児 提交于 2019-12-19 09:57:32
问题 I have updated the selenium chromedriver to 76.0.3809.68 and the existing tests started to fail with new Select(webElement).selectByVisibleText(value) is failing with the following exception org.openqa.selenium.WebDriverException: unknown error: script returns unexpected result (Session info: chrome=76.0.3809.87) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'VARGHESEV10', ip: '10.13.36.28', os.name: 'Windows 10', os.arch: 'amd64', os

What is default location of ChromeDriver and for installing Chrome on Windows

℡╲_俬逩灬. 提交于 2019-12-19 08:49:10
问题 I need to install chromedriver on Windows OS. In the article below they specify: https://sites.google.com/a/chromium.org/chromedriver/getting-started "...ChromeDriver expects you to have Chrome installed in the default location for your platform..." But I'm not sure what is the default location ? On Mac OS it's /usr/local/bin . With this I don't have to specify path explicitly or setup system path either. How to achieve the same on Windows OS? 回答1: For any driver that Selenium must use to

Selenium 'WebElement' object has no attribute 'Get_Attribute'

 ̄綄美尐妖づ 提交于 2019-12-19 06:02:15
问题 I'm using Selenium webdriver (chrome) with Python, trying to get the href from all the links on the page. when I try the following: items = driver.find_elements_by_tag_name("a") print items for item in items: href = item.Get_Attribute('href') print href It manages to get all the links, but on get_attribute I get an error: 'WebElement' object has no attribute 'Get_Attribute' Though everywhere I looked it seems like it should work. Any solutions? Thanks! 回答1: The "Get_Attribute" property doesn

ChromeDriver: Custom Chrome Executable Path

南楼画角 提交于 2019-12-19 04:06:09
问题 I'm using the portable version of Google Chrome. Since WebDriver expects the default installation path, it does not find the portable one which obviously is at another location: Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 11.13 seconds Build info: version: '2.35.0'