~/talk

High Fidelity Web Crawling in Python

Talkat PyData Seattle 2017 · 2017-06-30..07-02· [web-platform, python]
links:none on file
slides:none on file

Shows concrete techniques: use Python Requests for simple pages and Selenium + headless browsers (PhantomJS now moving to Chromium) for JavaScript, add logging and alerts, use expected-conditions and retry loops to recover from timeouts, and throttle via random sleeps. Runs 100,000 pages weekly and sees runtime jump 2 to 72 hours when polite proxies and delays are used; rotate a few proxies (2–5) and randomize from a large list like 900 user-agent headers. Applied to hockey player pages and yields usable data for scouting and drafting.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Python scraping needs robustness
  3. 4:56Basic scraping example
  4. 6:01Simple scripts fail in production
  5. 7:08Logging and alerting
  6. 8:12Dynamic JavaScript sites
  7. 10:40Waiting for JavaScript
  8. 12:30Retrying failed requests
  9. 13:54Scraper blocking and ethics
  10. 14:57Proxy servers
  11. 16:44Randomizing proxies and agents
  12. 17:48Throttling requests
  13. 19:54Speed versus anti-bot
  14. 20:15Three lessons for production
  15. 22:04Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.