Evading Selenium Detection: The Ultimate Guide

What guide do you want to see next


  • Total voters
    82
I recently moved from Selenium to Playwright and all i can say is that i will never look back. (Way) better documentation, no need to wait for elements (as it does that already under the hood), more readable code in general and more stable. You should definitely try that out!
I moved to PlayWright foe few days till now. Everything is good. I'm learning PlayWright Python.
Do you use PlayWright with Python or Java?

I have a question that what is the best plugin for PlayWright Steath that hide from bot detection?
I'm planning using it with antidetect browser
 
Do you use PlayWright with Python or Java?
I'm using playwright for python.

I have a question that what is the best plugin for PlayWright Steath that hide from bot detection?
I'm planning using it with antidetect browser
I never used an antidetect browser with it. Just chromium. I do tweak a bit though (change window-size, user-agent spoofing, etc.).
 
I have a question that what is the best plugin for PlayWright Steath that hide from bot detection?
I'm planning using it with antidetect browser

Update: i achieved very good stealth with the following:

Python:
class Browser:
    def __init__(self, user_agent=None, proxy_url=None, headless=False, timeout=15):
        self.playwright = sync_playwright().start()

        self.browser = self.playwright.firefox.launch(
            headless=headless,
            proxy={"server": proxy_url} if proxy_url else None,
        )

        self.ctx = self.browser.new_context(
            user_agent=user_agent, viewport={"width": 1920, "height": 1080}
        )

        self.ctx.add_init_script(
            "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
        )

        # WebRTC leak prevention
        self.ctx.add_init_script(
        """
        if (window.RTCPeerConnection) {
            const originalRTCPeerConnection = window.RTCPeerConnection;
            window.RTCPeerConnection = function(config) {
                if (config && config.iceServers) {
                    config.iceServers = []; // Remove all iceServers to prevent IP leakage
                }
                return new originalRTCPeerConnection(config);
            };
            window.RTCPeerConnection.prototype = originalRTCPeerConnection.prototype;
        }

        window.RTCSessionDescription = undefined;
        window.RTCIceCandidate = undefined;
        """
        )

        self.page = self.ctx.new_page()
        self.page.set_default_navigation_timeout(timeout * 1000)
 
I'm intergrated PlayWright with Kameleo, the antidectect browser.
The browser have many option for fingerprint, do you think that enough?
depends on the exact case. if we talk about like a pretty good WAF and anti-bot system, then it’s not enough, since even your network stack leaves a lot of fingerprints (TCP etc). also it depends on how you actually automate your browser, how you move your mouse etc (I used to implement curve-like pathways for mouse cursor etc). it’s always a cat and mouse game and there is no silver bullet, you should dive deep into how such systems work to use your bot in the long run
 
Wow someone put in the work, thanks for this share! Was hoping this wouldn't be a real project but definitely seems to be, but very grateful for all the time you just saved!
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock