admin管理员组文章数量:1310461
The below example:
from seleniumbase import SB
with SB(uc=True, locale_code="en", headless=True) as sb:
link = "/"
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:
How can I prevent this?
EDIT:
I think I found this issue here
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.
The below example:
from seleniumbase import SB
with SB(uc=True, locale_code="en", headless=True) as sb:
link = "https://antoinevastel/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:
How can I prevent this?
EDIT:
I think I found this issue here
https://github/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.
Share Improve this question edited Feb 4 at 0:37 Ajeet Verma 3,0813 gold badges17 silver badges28 bronze badges asked Feb 3 at 23:06 sudoExclamationExclamationsudoExclamationExclamation 8,80210 gold badges51 silver badges119 bronze badges1 Answer
Reset to default 0I found a similar issue here
https://github/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.
I tested it on a regular Chrome browser and I also got the same Inconsistent value. So author is correct.
SeleniumBase with CDP passes the other sites below:
https://deviceandbrowserinfo/info_device
https://bot.sannysoft
https://demo.fingerprint/playground
https://bot-detector.rebrowser
https://pixelscan
本文标签: selenium webdriverSeleniumBased in CDP Mode fails web driver fingerprintStack Overflow
版权声明:本文标题:selenium webdriver - SeleniumBased in CDP Mode fails web driver fingerprint - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741793771a2397813.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论