A web scraper-based calendar for AMC Theatres' movie showtimes.
I'm not a huge fan of AMC Theatres' existing UI, which requires you to click through every single day to browse showtimes. Through web scraping, every page can be fetched in advance to create a structured calendar-like UI.
poetry used for package management.
-
requests: Downloads website pages.import requests html = requests.get(url).text
-
BeautifulSoup: Parses HTML. (lxmlis the html parser being used)from bs4 import BeautifulSoup soup = BeautifulSoup(html, "lxml")
If the webpage's contents are loaded using js, not static html.
Playwright(MODERN!): loads web pages with JS.Selenium: older browser automation, use only if Playwright fails.
re(RegEx): pattern extraction.json: "save sample outputs and inspect them."pprint: pretty-print nested dictionaries.
Connecting python script to JS.
fastapi: exposes scraped data as an api endpoint.uvicorn: "run the FastAPI server."