Access Denied You don’t have permission to access “http://zeenews.india.com/technology/iphone-15-vs-google-pixel-10a-which-smartphone-gives-better-value-price-camera-features-battery-compared-3057271.html” on this server. Reference #18.54fdd417.1782247459.2f7d5cb5 https://errors.edgesuite.net/18.54fdd417.1782247459.2f7d5cb5
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/why-your-smartphone-suddenly-says-liquid-detected-even-when-its-dry-top-reasons-3057306.html” on this server. Reference #18.c4f43717.1782227004.2c287d4c https://errors.edgesuite.net/18.c4f43717.1782227004.2c287d4c
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/samsung-galaxy-m47-5g-india-launch-date-announced-snapdragon-chip-120hz-amoled-display-45w-charging-and-more-3057296.html” on this server. Reference #18.c4f43717.1782217230.2b295a79 https://errors.edgesuite.net/18.c4f43717.1782217230.2b295a79
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/hack-of-the-day-is-your-charger-secretly-damaging-your-smartphone-battery-heres-how-to-check-3057121.html” on this server. Reference #18.eff43717.1782191944.1b03bbe7 https://errors.edgesuite.net/18.eff43717.1782191944.1b03bbe7
Building Browser-Using AI Agents in Python
In this article, you will learn how to build AI agents that can browse and interact with real websites using Playwright, browser-use, and LangGraph. Topics we will cover include: Why Playwright is the right foundation for browser automation in 2026, and how it differs from Selenium. How to scrape dynamic, JavaScript-rendered pages and complete multi-step forms reliably. How to wire browser actions into LangGraph and browser-use agents, handle anti-bot detection, manage waiting and session persistence, and deploy the result in Docker. Building Browser-Using AI Agents in Python Introduction Most AI agent tutorials start with an API. They show you how to call OpenWeather, hit the Stripe endpoint, pull data from GitHub. That is a fine starting point until you try to build something real and realize that the task you actually need done does not have an API. Think about what humans do with browsers every day: filing government forms, reading competitor pricing, extracting research from sites that guard their data behind JavaScript rendering, logging into portals that have never heard of OAuth. There are roughly 1.1 billion websites on the internet. A vanishingly small fraction of them have public APIs. The rest only speak browser. An agent that is limited to API calls handles maybe 5% of the tasks a human worker does daily. Give that agent a browser, and the coverage approaches everything. That is the gap this article closes. The global AI agents market stands at \$10.91 billion in 2026 and is projected to reach \$50.31 billion by 2030, with browser-capable agents at the center of that growth. 27.7% of enterprises are already running agentic browsers in production, up from virtually none two years prior. The tooling has matured fast, and the patterns are settled enough to teach properly. By the end of this article, you will have a working browser agent that navigates real websites, fills forms, extracts structured data, and connects to an LLM that decides what to do next, all in Python. Why Playwright, Not Selenium If you built browser automation five years ago, you built it with Selenium. Selenium is still widely deployed, still works, and is not going anywhere. But for any new project in 2026, Playwright is the default. The reasons are practical, not theoretical. Selenium communicates with the browser by sending individual HTTP requests to a WebDriver. Every action, click, type, scroll, is a separate request. Playwright uses a persistent WebSocket connection for the entire session. Commands flow through that channel with no per-action round-trip cost. Independent benchmarks consistently show Playwright running 30-50% faster than Selenium at the test-suite level and averaging ~290ms per action versus Selenium’s ~536ms. For a browser agent that might execute hundreds of actions, that gap compounds. Playwright also bundles its own browser binaries. When you install it, you get pre-configured versions of Chromium, Firefox, and WebKit that are guaranteed to work with your Playwright version. No driver version mismatches, no broken CI pipelines because someone updated Chrome. It has built-in auto-waiting before it clicks an element; it verifies the element is visible, enabled, and not animating. You do not have to write time.sleep(2) and hope for the best. For AI agents specifically, Playwright fires real mouse and keyboard events that mirror how humans interact with browsers. Sites designed to detect automation look for synthetic DOM clicks. Playwright’s interaction model is harder to distinguish from genuine human input. There is also the browser-use library, which sits one level higher. Browser-use is a Python library that gives an LLM a working browser. Under the hood, it uses Playwright to drive the browser, but the LLM reads the page state and decides what to click, type, and extract, no CSS selectors required. You give it a task in plain English, and it figures out the rest. We will cover both raw Playwright and browser-use in this article, because they serve different needs: Playwright when you want precise, predictable control; browser-use when you want the agent to handle navigation decisions autonomously. Setting Up the Environment You need Python 3.10 or higher, an OpenAI API key, and about five minutes. Step 1: Create a virtual environment python -m venv browser_agent_env # macOS / Linux source browser_agent_env/bin/activate # Windows browser_agent_env\Scripts\activate python –m venv browser_agent_env # macOS / Linux source browser_agent_env/bin/activate # Windows browser_agent_env\Scripts\activate Step 2: Install dependencies pip install playwright \ browser-use \ langchain \ langchain-openai \ langgraph \ langchain-community \ python-dotenv pip install playwright \ browser–use \ langchain \ langchain–openai \ langgraph \ langchain–community \ python–dotenv Step 3: Install the browser binariesThis is the step most people miss. Playwright needs to download Chromium, Firefox, and WebKit separately from the Python package. Run this once after installing: playwright install chromium playwright install chromium If you want all three browser engines: playwright install. Chromium alone is sufficient for most agent work and is smaller to download. Step 4: Store your API keyCreate a .env file in your project directory: OPENAI_API_KEY=your_openai_api_key_here OPENAI_API_KEY=your_openai_api_key_here Add .env to your .gitignore immediately. Do not commit API keys. Step 5: Verify everything worksHere is a first script that navigates to a URL, reads the heading, and saves a screenshot. Use example.com, a publicly available test domain maintained by IANA that will not block you. How to run: Save as first_run.py and run python first_run.py # first_run.py # Navigate to a URL, take a screenshot, and extract the page title. # Prerequisites: pip install playwright && playwright install chromium # How to run: python first_run.py import asyncio from playwright.async_api import async_playwright async def main(): async with async_playwright() as p: # Launch Chromium in headless mode (no visible browser window). # Set headless=False if you want to watch it run during development. browser = await p.chromium.launch(headless=True) # A browser context is like a fresh browser profile. # It isolates cookies, storage, and cache from other contexts. context = await browser.new_context( viewport={“width”: 1280, “height”: 720}, 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″ ) )
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/microsoft-office-2021-support-ends-october-13-no-more-security-updates-heres-what-you-must-do-now-3057051.html” on this server. Reference #18.c4f43717.1782138308.2512e0a7 https://errors.edgesuite.net/18.c4f43717.1782138308.2512e0a7
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/oppo-reno-16-series-india-launch-teased-expected-price-specs-and-what-we-know-so-far-3056940.html” on this server. Reference #18.eff43717.1782113519.174e93d7 https://errors.edgesuite.net/18.eff43717.1782113519.174e93d7
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/iphone-battery-health-below-80-heres-how-much-it-affects-resale-value-3056608.html” on this server. Reference #18.c4f43717.1781959425.14ec097e https://errors.edgesuite.net/18.c4f43717.1781959425.14ec097e
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/true-5g-signal-but-no-internet-heres-why-your-smartphone-shows-bars-but-nothing-loads-3056593.html” on this server. Reference #18.c4f43717.1781955434.146b364b https://errors.edgesuite.net/18.c4f43717.1781955434.146b364b
Access Denied
Access Denied You don’t have permission to access “http://zeenews.india.com/technology/i-have-an-iphone-12-how-much-exchange-price-will-i-get-on-buying-iphone-17-heres-the-breakdown-3056532.html” on this server. Reference #18.eff43717.1781947236.dcb75e6 https://errors.edgesuite.net/18.eff43717.1781947236.dcb75e6