0

I am trying to use the url of a webpage that I navigated onto using Selenium, to access the webpage using Jsoup.

However, when I try to do so, I receive the following message in the console: "WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to org.seleniumhq.selenium:selenium-devtools-v86:4.0.0 where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's."

I am not sure what I am doing wrong, or of another way to go about achieving this.

System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir").concat("\\chromedriver" + ".exe"));
WebDriver driver = new ChromeDriver();
driver.get("https://www.chapters.indigo.ca/en-ca/");
WebElement webElement = driver.findElement(By.id("header__quick-search"));
webElement.sendKeys("9780385697378");
webElement.submit();
driver.findElement(By.className("product-list__product-title")).click();
String url = driver.getCurrentUrl();
final Document document = Jsoup.connect(url).get();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
778899
  • 9
  • 1
  • 2

1 Answers1

0

This error message...

WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.0.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

...implies that the Selenium version you are using doesn't supports the browser version.


Details

You are using Chrome Version 86 and Senenium v4.0.0. But CHANGELOG of Selenium v4.0.0 mentions:

  • Supported CDP versions: 85, 93, 94, 95

As Selenium v4.0.0 doesn't supports Chrome Version 86 hence you see the error.


Solution

A possible would be to ensure that:

  • Selenium is updated to v4.1.3
  • Chrome is updated to Chrome v100.0
  • ChromeDriver is updated to ChromeDriver v100.0.4896.60 level which matches to chrome=100.0.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352