<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>192</id><slug>session-cookies-for-scrapers-part-10-192</slug><title>Session cookies for scrapers, part 10</title><excerpt>Part 10 looks at what changes when the same technique has to run every day in production. Logging in once and staying logged in is a matter of keeping the cookies the server gives you and sending…</excerpt><seriesName>Session cookies for scrapers</seriesName><seriesPart>10</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>Part 10 looks at what changes when the same technique has to run every day in production. Logging in once and staying logged in is a matter of keeping the cookies the server gives you and sending them back on every later request.</item></paragraphs></item><item><heading>Putting it into practice</heading><paragraphs><item>Write small, focused tests for your parsers using saved HTML fixtures. They run in milliseconds and catch layout changes long before a full crawl would.</item><item>Deduplicate as you go. The same item often appears on several listing pages, and a stable identifier such as a SKU or ID makes duplicates easy to spot.</item><item>Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.</item></paragraphs></item><item><heading>Common pitfalls</heading><paragraphs><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><item>Read the site's terms of service before you start. Many sites welcome automated access within limits and say so explicitly; others ask you to use an API instead.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Use a session object (requests.Session, a Playwright context) for the whole run, and check for redirects to the login page as a sign the session has expired.</item></paragraphs></item></sections><authorId>5</authorId><authorName>Chen Patel</authorName><authorSlug>chen-patel</authorSlug><category>Scraping Basics</category><tags><item>selenium</item><item>python</item><item>javascript</item></tags><publishedAt>2026-02-09T00:00:00.000Z</publishedAt><wordCount>206</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
