Build a working web browser from scratch in a few thousand lines of Python
Web Browser Engineering
Pavel Panchekha and Chris Harrelson's Web Browser Engineering is a free online book that walks you through constructing a basic but complete browser in a couple thousand lines of Python. It covers networking and HTTP, HTML parsing, CSS layout, JavaScript-driven interactivity, cookies and XSS/CSRF defenses, plus modern topics like GPU compositing, the event loop, accessibility, and invalidation.
Web browsers are ubiquitous, but how do they work? This book explains, building a basic but complete web browser, from networking to JavaScript, in a couple thousand lines of Python.