{"id":102,"date":"2026-10-06T11:15:00","date_gmt":"2026-10-06T11:15:00","guid":{"rendered":"https:\/\/top.fadah.store\/?p=102"},"modified":"2026-10-06T11:15:00","modified_gmt":"2026-10-06T11:15:00","slug":"bypass-cloudflare-403-python-playwright","status":"publish","type":"post","link":"https:\/\/top.fadah.store\/?p=102","title":{"rendered":"Bypassing Cloudflare 403 While Scraping Real Estate Data with Python and Playwright"},"content":{"rendered":"<p>I was building an automated Python scraper to track local real estate price drops. The target website was protected by Cloudflare Turnstile, and simple <code>requests<\/code> or vanilla <code>Playwright<\/code> runs immediately resulted in a <code>403 Forbidden<\/code> block.<\/p>\n<h2>Why Standard Headless Browsers Fail<\/h2>\n<p>Cloudflare checks navigator properties, WebGL fingerprints, and browser automation flags like <code>navigator.webdriver = true<\/code>. When you launch standard headless Chromium, these flags give you away instantly.<\/p>\n<h2>The Solution: playwright-stealth and Realistic Viewports<\/h2>\n<p>The fix involved using <code>playwright-stealth<\/code> along with persistent browser contexts and human-like user agent headers.<\/p>\n<pre class=\"wp-block-code\"><code class=\"language-python\">import asyncio\nfrom playwright.async_api import async_playwright\nfrom playwright_stealth import stealth_async\n\nasync def scrape_listings():\n    async with async_playwright() as p:\n        browser = await p.chromium.launch(headless=True)\n        context = await browser.new_context(\n            user_agent=\"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/124.0.0.0 Safari\/537.36\",\n            viewport={\"width\": 1920, \"height\": 1080}\n        )\n        page = await context.new_page()\n        await stealth_async(page)\n        \n        await page.goto(\"https:\/\/target-realestate-site.com\/properties\", wait_until=\"networkidle\")\n        print(\"Page title:\", await page.title())\n        await browser.close()\n\nasyncio.run(scrape_listings())<\/code><\/pre>\n<h2>The Result<\/h2>\n<p>The stealth patch removed the automated webdriver signatures, allowing the script to pass Cloudflare challenges seamlessly on every hourly run.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was building an automated Python scraper to track local real estate price drops. The target website was protected by Cloudflare Turnstile, and simple requests or vanilla Playwright runs immediately resulted in a 403 Forbidden block. Why Standard Headless Browsers Fail Cloudflare checks navigator properties, WebGL fingerprints, and browser automation flags like navigator.webdriver = true. &#8230; <a title=\"Bypassing Cloudflare 403 While Scraping Real Estate Data with Python and Playwright\" class=\"read-more\" href=\"https:\/\/top.fadah.store\/?p=102\" aria-label=\"Read more about Bypassing Cloudflare 403 While Scraping Real Estate Data with Python and Playwright\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[12,10,9,11],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-python","tag-cloudflare","tag-playwright","tag-python","tag-web-scraping"],"_links":{"self":[{"href":"https:\/\/top.fadah.store\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/top.fadah.store\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/top.fadah.store\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/top.fadah.store\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/top.fadah.store\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":0,"href":"https:\/\/top.fadah.store\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"wp:attachment":[{"href":"https:\/\/top.fadah.store\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/top.fadah.store\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/top.fadah.store\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}