A small Python 3 script from 2020, written as freelance work: given a list of Chinese stock names, find and download each company's latest annual report as a PDF, and log the result — company, date, report name, source page, and download link — to a CSV file. It followed right after two German newspaper scrapers I built for fun, using the same BeautifulSoup-based scraping patterns on a paid project.
Search instead of hardcoding URLs. Rather than trying to guess or
maintain a URL pattern per company on the source site
(vip.stock.finance.sina.com.cn), the script uses the Google Custom Search
API to find the right investor-relations page for each stock, checks the first few
results for a match, then scrapes that page with BeautifulSoup to pull out the report
listing and the actual PDF link. It's also idempotent — if a report's already been
downloaded, a re-run skips it instead of re-fetching.
One practical wrinkle: the report listing page was heavy enough that it needed a long request timeout and a decent network connection to reliably load — running it from a server with fast network beat running it locally.
This was client work, so the source isn't public and the actual list of stocks isn't something I can share here — but the technique (search-then-scrape, rather than one-off URL guessing per target) is the reusable part.