This 2015 update revisits an earlier Python experiment that collected public search-result pages. The original approach depended on an older xgoogle fork, and changes to result markup and paging behavior meant that a script which once returned several pages could no longer be trusted without fresh checks.
Re-check every assumption
Search interfaces change frequently. A parser should be treated as a fragile integration, not as a stable API: verify what fields are actually present, detect when the response is an error or challenge page, and stop cleanly when the expected structure is missing. Quietly returning incomplete data is worse than reporting that the source has changed.
Prefer supported sources
For a current project, use the search provider's documented API or another licensed data source whenever one fits the task. Review the site's terms and access rules, respect rate limits, and do not try to bypass blocks or access controls. A small delay cannot make an unsupported collection method reliable or authorized.
Make collection bounded and observable
- Set a clear maximum scope and avoid repeatedly requesting the same pages.
- Record response status and parsing failures so source changes are visible.
- Use conservative retries with backoff for temporary failures, and stop on persistent errors.
- Test parsing against saved, permitted examples rather than sending requests during every unit test.
The main lesson from the 2015 redux is that a script can become obsolete even when its code has not changed. Reassess the source, the rules, and the quality of the output before investing in a parser that depends on a moving page.
