Repository navigation
Releases
Releases · 2scraper/lidl-scraper
v0.4.4
Fixed
- A malformed proxy line was echoed in the error message, which can expose its password. The message now names the accepted formats instead.
- pyppeteer turns proxy-auth request interception off before closing the browser, so no unretrieved "Target closed" error reaches stderr. Verified live through an authenticated proxy.
v0.4.3
Fixed
- pyppeteer could not use a proxy with a login and password:
page.authenticate()relies onNetwork.setRequestInterception, which current Chrome no longer has, so every such run crashed. Proxy credentials are now answered through the CDPFetchdomain, and only for the proxy's own challenge. Verified live through an authenticated HTTP proxy with a US residential exit. - A
socks5://proxy with a login and password crashed Playwright with a traceback. It is now refused as bad usage (exit 2) with a message that does not echo the password, since Chromium cannot authenticate to a SOCKS proxy.
Changed
.gitignorecovers the per-engine.venv-*/environments that TESTING.md creates.
v0.4.2
Fixed
--fingerprintnever applied a user agent. The live Fingerprint API returns it atuserAgent.userAgent(andnavigator.userAgent), notuserAgent.value, so every run silently kept the browser's own UA. Verified live: the Playwright run now reports the profile's UA innavigator.userAgent.- A profile without a user agent now logs a warning instead of passing silently.
v0.4.1
Fixed
- pyppeteer over
--cdp-endpointcould hang forever. The Scraping Browser API refuses a new WebSocket with 500profile_lockedwhile another session still holds the profile — for a few seconds after the previous run, too — and pyppeteer'sconnect()never returns then. It now gives up after 30 s with the usual "CDP connection failed" (exit 5), as Playwright already did. - Every
--cdp-endpointrun warned "Ignoring --fingerprint" although--fingerprintwas not passed. The warning now appears only when it was.
Verified live, 2026-10-18 — the Scraping Browser path
- Playwright and pyppeteer over
--cdp-endpoint(a US Scraping Browser session):whole milkwith--store-id 1449priced at the store ($4.25) in both,milk --max-results 60complete with 60 rows, and the weekly-favorites deals page with the same 53 rows, 18 discounts and 10 Lidl Plus prices as a local run. No credential appeared in any log or output. - Selenium refuses a credentialed endpoint with exit 2, as documented.
- Two runs back to back on one profile can hit
profile_locked; the second then exits 5. Leave a few seconds between runs. - pyppeteer logs "Future exception was never retrieved … Target.detachFromTarget: No session with given id" when it closes the remote browser. It is pyppeteer's own clean-up noise and does not affect the run.
v0.4.0
Behaviour changes in this batch.
--store-id/--zipnow choose the store a run is priced at, instead
of only annotating rows. They look the store up in Lidl's store API
before the browser starts, so they need network access to lidl.com and
live.api.schwarz; a store that does not exist exits 2, an unreachable
store API exits 5. Rows record the store actually used (US01449, its
5-digit zip), which can differ from a--zipthat has no store.--zipno longer adds?zip=to the search URL.- New output column
unit_price_per, right afterunit_price.- A search Lidl answers with its no-match page exits 4 (empty) with
stop_reason: no_match. It used to exit 0 with the unrelated
products that page shows, or exit 3 when the page came as a 404.--max-scrollsdefaults tomax(20, --max-results / 4 + 10).--sort newestis new.- Product-page rows use the listing's sku (
lidl-11675058, not JSON-LD's
lidl-11675058001) and thewww.lidl.comURL.
Fixed
--sort price_asc/price_descsent values the site does not know;price_ascgot a page with no products at all. They now sendpriceandprice-desc, the values the site's own Sort By control uses.- A product page's
unit_sizewas every description bullet run together ("pasteurizedhomogenized…gallon"). It now comes from the page's price block, or from a description bullet that reads as a size. - A product page lost its old price, discount and Lidl Plus price: its JSON-LD carries only the public price. They now come from the buybox, which renders the same price block as a listing tile.
--categoryalways prefixed/c/, so aisle listings (/h/…/h…), where Lidl actually lists products, could only be reached through--url. A path starting withh/now goes under/h/.- The Playwright engine warned "No products recognised on the first render" on successful aisle runs, whose grid fills in after the first render. All three engines now warn once, at the end of a run that found nothing.
- pyppeteer on Apple Silicon died with "Browser closed unexpectedly": pyppeteer 2.0 downloads an x86_64 Chromium. It now uses an installed Google Chrome there when
PYPPETEER_EXECUTABLE_PATHis not set.
Added
lidl_stores.py: store lookup by number or zip, and the four cookies (st,wh,zn,ar) the site's own store picker sets, applied before the first navigation in all three engines.unit_price_per: the unitunit_priceis quoted in. Stores choose it: the same gallon reads 0.03 perfl.oz.with no store and 1.06 perqt.at US01449.- Fixtures from real captures:
tests/fixtures/lidl_product_real.html(a product page) andtests/fixtures/lidl_no_match_real.html(the no-match page with its fallback grid).
Verified live, 2026-10-18
--query "whole milk" --store-id 1449in all three engines: the gallon at $4.25 (vs $3.48 with no store), rows markedUS01449/07086.--zip 28202picked US01497 in Charlotte, with its own prices.--sort price_ascandnewest,--category h/cheese-dairy-eggs/h10095761 --max-results 200(complete, 200 rows, no--max-scrollsneeded), a product page with a Lidl Plus price, the no-match page, and US01575's 404 search, which now exits 4.diff_runs.pyon real runs: no changes between Selenium and pyppeteer's 60-row runs, none between JSON and CSV of the same search; the three Maola milks it flagged between a morning run and a later one (38.0 → 2.99) were the deal-badge price bug fixed in 0.3.0.
v0.3.0
Behaviour changes in this batch.
- New output column
lidl_plus_price, betweenis_weekly_dealand
deal_valid_from. CSV consumers that read columns by position need
updating.priceis what a shopper without the Lidl Plus app pays. On a tile
discounted only for Lidl Plus members,priceis the struck-through
price and the member price is inlidl_plus_price.- On a Lidl Plus tile
unit_priceis null: Lidl prints only the member
per-unit price there (the avocados' "$ 0.33 each" is 1.99 / 6).
Fixed
- A discounted tile reported its discount badge as the price:
"-20%$1.59*"becameprice: 20.0. The price now comes from.ods-price__value, so the red onions on/c/aw42-fresh-deals/a10104750read 1.59. Any search whose results included a deal was affected; the 2026-09-20 milk captures had none. unit_size/unit_priceare filled for per-piece footers ("6 Piece$ 0.33 each"), andunit_sizefor tiles with a Lidl Plus comparison, whose first.ods-price__footeris an empty nested one.
Added
- Listing rows now carry
image_url,original_price(the struck-through price),discount_pct(Lidl's own badge),is_weekly_dealandlidl_plus_price, confirmed against a real weekly-deals capture (tests/fixtures/lidl_deals_real.html). On both captured deals pages (74 tiles, 16 with a Lidl Plus price)price— orlidl_plus_price, where present — matches the tile's owndata-gridbox-impressionprice.
Verified live, 2026-10-18
- Selenium and pyppeteer end to end:
--query "whole milk" --max-results 10and--query milk --max-results 60each exit 0 withstatus=completeand price coverage 1.0; both 60-row runs return the same 60 product URLs at the same prices. pyppeteer 2.0 downloads an x86_64 Chromium that will not start on Apple Silicon, so these runs setPYPPETEER_EXECUTABLE_PATHto the installed Google Chrome. - Playwright on a weekly-deals listing (
--url https://www.lidl.com/c/aw42-weekly-favorites/a10104751): 53 products, 18 with a public discount, 10 with a Lidl Plus price, every row with an image.
Changed
- CI only: the whole canary, free and paid jobs alike, now runs weekly (Mondays 06:37 UTC) and on a manual dispatch; the daily schedule is removed.
v0.2.0
Behaviour changes in this batch.
- A local engine no longer BUYS a captcha solve. None of them injects a
token into the page, so a bought token could never clear a challenge;
the page is now reported blocked (exit 3) without creating a 2Captcha
task. Before, one blocked page bought one solve per scroll round (5 with
default flags, 21 with--max-scrolls 20 --stall-rounds 20).
--cdp-endpointis unaffected.- A served page whose own "N Products" counter states products while the
parser recognises none now exits 5 with a sidecar
(status: failed,stop_reason: parser_found_nothing,
output_written: false), instead of exit 4 "no products".- A run that collected rows and was then blocked or hit a remote error
now exits 6 (partial) instead of 3/5;stop_reasonkeeps the cause.- Negative
--retries,--retry-delay,--scroll-delayand
--proxy-block-retries, and a--min-scoreoutside 0..1, are usage
errors (exit 2) in every engine. Selenium and pyppeteer used to accept a
negative--retriesand never navigate.--urltogether with--query/--categoryis a usage error (exit 2).
ALIDL_URLfrom the environment or.envno longer overrides a typed
--query/--category, and.env.exampleships it commented out.
Fixed — 2026-10-14 audit
- Output files and the sidecar are written atomically (temp file in the
same directory, fsync, rename), so an interrupted write leaves the
previous file intact instead of a truncated one. New files follow the
umask; an existing file keeps its mode. - CSV output prefixes text cells starting with
=,+,-,@, a tab or
a line break with', so a spreadsheet does not execute them. JSON is
unchanged; the sidecar recordscsv_cells_escaped. - Paid captcha solves go through one per-page allowance
(captcha_solver.SolveBudget,SOLVES_PER_PAGE = 1) checked before any
purchase and shared by every scroll round. - The sidecar's
stop_reasonnow says why the run ended (max_results,
stalled,max_scrolls,incomplete_grid,scroll_failed,
parser_found_nothing,navigation_failed,blocked, …) instead of
repeatingstatus. diff_runs.pyrefuses runs that started from different URLs or carry
differentzip_code/store_idvalues, and compares prices as numbers,
so the same run saved as JSON and as CSV no longer diffs as "changed"..gitignorecovers every renamed.envcopy (.env.bak,.env.local,
…) and raw dump directories and files (live/,out/,*.pageN, a
root-level*.html).- The credential scan is one script,
.github/ci_checks.py, run by CI and
bysmoke_test.py. It now also catches unquoted and JSON-escaped key
fields, bare 32-hex keys and URLs with embedded credentials, scans
untracked files, and skips virtualenvs bypyvenv.cfg. - The numeric argparse validators live in one module (
run_policy.py) and
are shared by all three engines. - The canary's Scraping Browser job fails, naming the missing
LIDL_CDP_ENDPOINTsecret, instead of skipping green; the local job also
checks that core columns are non-null on every row. - Comments and docs no longer cite private maintainer notes.
v0.1.0
First tagged build of lidl-scraper, the third member of the 2scraper family, alongside stockx-scraper and skyscanner-scraper.
What's in this release
- Three engines sharing one output contract — Playwright (primary, local-first), Selenium, and Puppeteer (via pyppeteer) — same exit codes, same
Productschema, same CLI shape. - Search by product term, or browse a weekly-deals/specials category. JSON or CSV output, with a documented
Productschema and a.meta.jsonsidecar on every completed/partial run. - Grocery-specific fields the sibling repos don't need: unit price, unit size, original (pre-discount) price, discount %, weekly-deal flag, and the store/zip a price reflects.
- Optional 2Captcha integration (captcha solving, Scraping Browser API, Fingerprint API, proxies) — wired in but never required. The default is a plain local headless Chromium: no proxy, no key, no account.
Live-verified against the real site
- The real search URL (
https://www.lidl.com/q/search?q=<query>) and the site's actual framework (Nuxt.js, not the originally-guessed Next.js) are confirmed from a real, browser-rendered capture — not a guess. playwright_scraper.pyhas been run end-to-end against the real, live site multiple times, including a--max-results 60query that crosses Lidl's first lazy-loaded batch: 60 unique SKUs collected across 11 rounds,status: "complete", price coverage 1.0.- Handles Lidl's virtualized/batched result grid: walks viewport-sized scroll steps, clicks the real "View More Products" control (dispatched through the DOM to get past a OneTrust consent overlay), and cross-checks the collected product count against Lidl's own "N Products" counter for an arithmetic completeness guarantee — a scroll limit hit before that count is reached now reports
partialinstead of a falsecomplete.
Still open
- The markup of an actual discounted/"weekly deal" tile — none has been captured live yet.
- Image extraction and the store/zip session-binding mechanism — not yet live-verified.
- Selenium and Puppeteer haven't had their own live end-to-end run yet (Playwright has, several times).
Full details, including what's confirmed vs. still a documented guess, in CHANGELOG.md and README.md.