selenium-chromedriver

How to rotate various user agents using selenium python on each request

徘徊边缘 提交于 2020-01-22 02:29:10
问题 I want to make 10 requests to https://www.google.com/ but with random user agents using selenium and python. I've a loop and inside that loop I'm making 10 requests with random user agents (using fake-user agent). The main problem is for every request web driver is opening a new instance of google chrome and I want to do this in one single instance but with different user agents. How can I make this possible ? 1 google chrome instance and 10 requests with 10 random user agents. Here is my

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80

一世执手 提交于 2020-01-22 02:14:09
问题 when i go to command prompt and type chromedriver -v: ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}) but when i try to run this code : from selenium import webdriver class InstaBot: def __init__(self): self.driver=webdriver.Chrome() self.driver.get("www.instagram.com") InstaBot() it gives me error like this: raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created:

Access Denied page with headless Chrome on Linux while headed Chrome works on windows using Selenium through Python

别说谁变了你拦得住时间么 提交于 2020-01-21 19:21:13
问题 I have this code that I'm using on my local machine: from selenium import webdriver chrom_path = r"C:\Users\user\sof\chromedriver_win32\chromedriver.exe" driver = webdriver.Chrome(chrom_path) link = 'https://www.google.com/' driver.get(link) s = driver.page_source print((s.encode("utf-8"))) driver.quit() and this code return page source of this website, however when I go on Linux server centos7 and I use this code: from selenium import webdriver options = webdriver.ChromeOptions() options.add

Chrome arguments doesn't work

…衆ロ難τιáo~ 提交于 2020-01-21 13:37:08
问题 anybody know why chrome arguments does't work? import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; public class testowa { public static void main(String[] args) throws InterruptedException { DesiredCapabilities capability = DesiredCapabilities.chrome(); capability.setCapability("chrome.args", Arrays.asList("--disable

MSEdgeDriver (Chromium) does not work after version 79.0.309.0

十年热恋 提交于 2020-01-21 10:20:11
问题 I'm using Microsoft Edge Webdriver (Chromium) with Python3 in my script. The webdriver configuration is as follows: driveroptions = Options() driveroptions.add_argument('--inprivate') driveroptions.add_argument('--disable-infobars') driveroptions.add_argument('--start-maximized') driveroptions.add_argument('--auto-open-devtools-for-tabs') driveroptions.add_argument('--user-data-dir=D:\\Selenium_Edge_Chromium_UserData') driveroptions.binary_location = "C:\\Users\\Administrator\\AppData\\Local\

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally with ChromeDriver Chrome and Selenium through Python on VPS

为君一笑 提交于 2020-01-20 08:51:23
问题 So I have the exact same error as these posts Selenium 'Chrome failed to start: exited abnormally' error Unknown error: Chrome failed to start: exited abnormally I tried what they recommended and it didn't work. Here is my code from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(800, 600)) display.start() options = webdriver.ChromeOptions() options.add_argument('--no-sandbox') options.add_argument('--disable-extensions') options.add_argument(

“Eager” Page Load Strategy workaround for Chromedriver Selenium in Python

南楼画角 提交于 2020-01-20 06:55:25
问题 I want to speed up the loading time for pages on selenium because I don't need anything more than the HTML (I am trying to scrape all the links using BeautifulSoup). Using PageLoadStrategy.NONE doesn't work to scrape all the links, and Chrome no longer supports PageLoadStrategy.EAGER. Does anyone know of a workaround to get PageLoadStrategy.EAGER in python? 回答1: ChromeDriver is the standalone server which implements WebDriver's wire protocol for Chromium. Chrome and Chromium are still in the

Selenium ChromeDriver how to disable the message:"DevTools on ws

纵饮孤独 提交于 2020-01-20 06:51:23
问题 So I am creating a bot with chrome headless browser and it works just fine. I had quite a lot warnings so I disabled them after reasearch with those commands: ChromeOptions option = new ChromeOptions(); option.AddArgument("--headless"); option.AddArgument("--silent"); option.AddArgument("--disable-gpu"); option.AddArgument("--log-level=3"); ChromeDriverService service = ChromeDriverService.CreateDefaultService(); service.SuppressInitialDiagnosticInformation = true; _driver = new ChromeDriver

org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75 using Selenium

瘦欲@ 提交于 2020-01-19 18:07:05
问题 I want to open the Chrome browser it displays error. import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Homepage { public static void main(String[] args) { // TODO Auto-generated method stub //Create Driver object System.setProperty("webdriver.chrome.driver", "C:\\Workdirectory\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); } } Here I am expecting My Chrome Browser but it throws an error like Starting ChromeDriver 75.0.3770.8

ChromeDriver ERR_SSL_PROTOCOL_ERROR despite --ignore-certificate-errors

为君一笑 提交于 2020-01-19 12:44:25
问题 I'm trying to run integration tests on a local host (with no HTTPS) using selenium with ChromeDriver. Chrome requires an https certificate, but from this question i understand that i can circumvent this using the arg --ignore-certificate-errors I have also added to my capabilities acceptInsecureCerts , as this seems like the appropriate course of action (docs) The response from the chromedriver is still not what I was expecting: This site can’t provide a secure connection app sent an invalid