Website link crawler (Crawlee and Playwright)
Give it one URL and it opens a real Chromium browser, follows same-site links and writes an inventory of every page to results.json.
- Period
- Nov 2025
- Technologies
- 2
- Diagrams
- 1
- Reading time
- 1 min
Source & download: Crawl a Website and Export Every Page URL and Title to JSON
What it does
Give one start URL; the crawler opens a real Chromium browser, and for each page: logs the URL, enqueue_links follows every internal <a href> (staying on-domain), and push_data stores {url, title, first 100 chars of HTML}. At the end export_data('results.json') writes the whole dataset.
Diagram as text
flowchart LR START[start URL] --> C[PlaywrightCrawler request_handler] C --> E[enqueue_links: internal hrefs → queue] C --> D[push_data: url, title, snippet] E --> C D --> J[(results.json)]
Notes
The committed run targets a PayHere support site (support.payhere.lk) — PayHere is the Sri Lankan payment gateway used in the owner’s commerce work (GoldStar P12, Munz P18), so this was likely mapping its docs. The default crawlee.dev example URL is commented out. A small, idiomatic Crawlee example; published as a portfolio how-to.
Related projects
VisaAgent: AI and RPA visa-form automation platform
My own product: AI document extraction plus Playwright automation that fills government visa forms, as desktop app, web and WhatsApp bot.
PlaywrightLLM integrationPythonFastAPI / Flask+6AI and LLM experiments
Experiments with LLM APIs: a Flask chat over several providers, speech-to-text and model tests, and a React and shadcn debugging sandbox.
PythonFastAPI / FlaskLLM integrationReact+1Bulk test-document generator and Stitch-to-PDF storyboard
Python scripts that batch-generate numbered test documents (Word to PDF, Pillow images) plus a Stitch-to-PDF storyboard for QA and design review.
PythonPDF & document generationWant to discuss this project?
Happy to walk through the architecture, trade-offs or the code.