<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>78</id><slug>headless-vs-headed-browsers-part-4-78</slug><title>Headless vs headed browsers, part 4</title><excerpt>Part 4 looks at what changes when the same technique has to run every day in production. Running a browser without a window is faster and works on servers, but some problems are much easier to…</excerpt><seriesName>Headless vs headed browsers</seriesName><seriesPart>4</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>Part 4 looks at what changes when the same technique has to run every day in production. Running a browser without a window is faster and works on servers, but some problems are much easier to understand when you can watch the browser do its work.</item></paragraphs></item><item><heading>Putting it into practice</heading><paragraphs><item>Selectors are the most fragile part of any scraper. Prefer stable attributes such as data-testid or semantic structure over generated class names, which can change on every deploy.</item><item>Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.</item><item>Be careful with relative URLs. Resolve every link against the page it came from, not against the site root, or you will request pages that do not exist.</item></paragraphs></item><item><heading>What to watch for</heading><paragraphs><item>Validate the data you extract. Prices without currencies, dates without time zones and empty fields are common sources of silent errors downstream.</item><item>Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them.</item><item>Dynamic pages render content after the initial HTML arrives. A browser automation tool can wait for a specific element to appear, which is far more reliable than sleeping for a fixed amount of time.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Develop headed with slow motion turned on, run headless in CI, and capture screenshots or traces on failure so headless runs are still debuggable.</item></paragraphs></item></sections><authorId>10</authorId><authorName>Aisha Rossi</authorName><authorSlug>aisha-rossi</authorSlug><category>Browser Automation</category><tags><item>python</item><item>playwright</item><item>http</item><item>javascript</item></tags><publishedAt>2025-11-23T00:00:00.000Z</publishedAt><wordCount>220</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
