Parser example: static XML feed
A complete parser for one static XML feed, streamed product by product to keep memory flat.
A complete product sync parser for the simplest case: a single static XML feed. The parser downloads the file once and streams it one <Product> element at a time, so memory stays flat on large files. If your source is one feed file, start here: copy the parser and adapt the field mapping to your feed.
For a source split across several files, see Parser example: multiple XML feeds. For an API that returns one page at a time, see Parser example: paginated JSON API.
Source shape: static-xml-single-feed
Fetching through the proxy. The _download helper tries a direct request first and falls back to fetch_via_proxy(), a built-in function that sends the request through Octocom's HTTP proxy from a stable, dedicated IP address. The fallback matters when the origin blocks direct requests. Typical symptoms are HTTPError 403, HTTPError 429 or unexplained urlopen timeouts. Signature:
fetch_via_proxy(url, *, headers=None, timeout=60, method='GET', data=None) -> bytes