Bot detection is a common challenge for web agents. This guide provides strategies to bypass these detection mechanisms using Notte’s stealth configuration options.Common Bot Detection Challenges:
Accessing e-commerce sites with anti-bot measures
Scraping content from news or social media platforms
Proxies are one of the most effective ways to bypass bot detection. Different proxy configurations can help you appear as legitimate traffic from various locations.
Enable Notte’s built-in residential proxies for better anonymity:
Copy
Ask AI
from notte_sdk import NotteClientnotte = NotteClient()# Start a session with built-in proxieswith notte.Session(proxies=True) as session: _ = session.observe(url="https://www.notte.cc/")
Different browsers have varying levels of detection resistance. Experiment with different browser types for your specific use case:
Copy
Ask AI
from notte_sdk import NotteClientnotte = NotteClient()# Try different browser typesbrowsers = ["chromium", "chrome", "firefox"]for browser in browsers: with notte.Session( browser_type=browser, proxies=True, solve_captchas=True ) as session: result = session.observe(url="https://example.com") print(f"Success with {browser}")
chromium is the default browser type but is the most easily detected.
Enable automatic CAPTCHA solving for sites that use these challenges:
solve_captchas.py
Copy
Ask AI
from notte_sdk import NotteClientnotte = NotteClient()with notte.Session( solve_captchas=True, browser_type="firefox", headless=False,) as session: # Navigate to a page with a CAPTCHA agent = notte.Agent(session=session, max_steps=5) resp = agent.run( task=( "Try to solve the CAPTCHA using internal tools. " "If you fail, try to solve it manually." ), url="https://www.google.com/recaptcha/api2/demo" )
Not all CAPTCHA types are supported. Some complex CAPTCHAs may still require manual intervention.
Here’s a comprehensive example combining all stealth techniques:
stealth_configuration.py
Copy
Ask AI
from notte_sdk import NotteClientfrom notte_sdk.types import NotteProxynotte = NotteClient()# Example stealth configuration# this is just one possible configuration, with an obvious fingerprint# rotating those values will raise your chancesstealth_config = { "solve_captchas": True, "proxies": [NotteProxy.from_country("us")], "browser_type": "chrome", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "viewport_width": 1920, "viewport_height": 1080,}# Try the stealth configurationwith notte.Session(**stealth_config) as session: result = session.observe(url="https://example.com") print("Success with fallback configuration")