🌐 English · Dansk · Bahasa Melayu
Assignment. Send browser-like headers with the request: at least User-Agent and Accept-Language.
What we built. DEFAULT_HEADERS in constants.py (without Host and X-Amzn-Trace-Id) and RequestsPageFetcher, which passes them as headers= to requests.get.
What a browser sends to httpbin.org/headers, and what the bot sends (Host is added by requests):


What we gained
- A request carries more than the URL: the browser, the system and the language travel in headers.
- With the right headers a server can answer in your language and currency.
- A script without headers looks like a bot, and many servers block bots.
- One read-only definition of the headers, and tests that check what is sent.