Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChromeDriver with Selenium displays a blank page

I am using Selenium(Java) with Chrome to access the following website:

https://www.ebay-kleinanzeigen.de/m-einloggen.html?targetUrl=/

The Problem is that it always displays a blank page. Here is my Code:

ChromeOptions cap = new ChromeOptions();
cap.setBinary("C:\\Program Files (x86)\\Google\\Chrome Beta\\Application\\chrome.exe");

System.setProperty("webdriver.chrome.driver","C:\\Users\\Admin\\Downloads\\chromedriver_win32beta\\chromedriver.exe");
WebDriver driver=new ChromeDriver(cap);


driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.manage().window().maximize();


    try {
        driver.get("https://www.ebay-kleinanzeigen.de/m-einloggen.html?targetUrl=/");

    }catch(Exception e){
        System.out.println(e);
    }

Every other website I have tried works just fine, but this one doesn't want to show up. I have tried to access this website from Firefox, Chrome and Edge, which also show a blank page. I am using Selenium(3.141.59), ChromeDriver(81.0.4044.20) and Chrome Beta(81.0.4044.62). Here is the HTML Code when I ispect the website:

Webpage is blank

like image 222
Udarnicus Avatar asked Sep 11 '25 02:09

Udarnicus


2 Answers

It looks like this site can detect Selenium and do not open with it.

You can hide it using Chrome Options. Try adding arguments like this before openning the url:

ChromeOptions options = new ChromeOptions();
options.addArguments("disable-blink-features=AutomationControlled");
ChromeDriver driver = new ChromeDriver(options);

Hope this helped, good luck!

like image 129
Svetlana Levinsohn Avatar answered Sep 13 '25 15:09

Svetlana Levinsohn


It works with selenium stealth and the following options

options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
like image 45
Victor Jouhoff Avatar answered Sep 13 '25 16:09

Victor Jouhoff