Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99025

SeleniumBased in CDP Mode fails web driver fingerprint

$
0
0

The below example:

from seleniumbase import SBwith SB(uc=True, locale_code="en", headless=True) as sb:link = "https://antoinevastel.com/bots/"print(f"\nOpening {link}")sb.wait_for_ready_state_complete(timeout=120)sb.activate_cdp_mode(link)print(f"Sleeping for some time...")sb.sleep(5)[screenwidth,screenheight,innerwidth,innerheight,scrollwidth,scrollheight] = sb.cdp.evaluate("return [window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, document.documentElement.scrollWidth, document.documentElement.scrollHeight];")print(f"Size: {screenwidth}, {screenheight}, {innerwidth}, {innerheight}, {scrollwidth}, {scrollheight}")sb.cdp.set_window_rect(0,0,scrollwidth + screenwidth - innerwidth, scrollheight + screenheight - innerheight + 100)print(f"Sleeping for some time...")sb.sleep(5)sb.cdp.save_screenshot(f"screenshot.png")print(f"Finished!")

Fails the WEBDRIVER test as it's shown in red color below:

enter image description here

How can I prevent this?

EDIT:

I think I found this issue here

https://github.com/seleniumbase/SeleniumBase/issues/3059

where the author says that he gets the same result as when using a regular Chrome browser, so the Inconsistent value for Webdriver there isn't accurate.


Viewing all articles
Browse latest Browse all 99025

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>