Repository navigation
fix(scraper): repair scraping broken in 0.1.5 (#31) - #32
Merged
Merged
Conversation
Scrapes crashed after the first ~10 reviews, long reviews stayed cut off, and a dead Google session was reported as signed in. - scroll: pass the scroll step into the page instead of reading a Node-side constant inside page.evaluate (ReferenceError on the second scroll) - expand: click each "More" button by a mark on the element and confirm the result; Google now removes the button on click, which made the positional loop skip every second review. Warn with the number of reviews that stay cut off - session: one check for "Google accepts this session" (getSessionState) used by auth, auth status and the sign-in wait; an expired session is no longer reported as signed in - limited view: typed AUTH_REQUIRED error, never retried, one message that says to run `revcli auth`, for every sort order; headed mode asks for sign-in and continues - non-place links fail once with NOT_A_PLACE - short links: wait for the in-page redirect before forcing hl=en, so signed-out and non-English profiles get an English page - errors: one top-level handler, no stack trace without --verbose, Playwright call logs removed from messages - tests: browser tests run the scroll, expand, session and navigation code in headless Chromium against local fixtures; CI installs Chromium - docs: README, AGENTS.md, selector maintenance guide, CHANGELOG Refs #31 Claude-Session: https://claude.ai/code/session_01PuLVjZfdZVDn9e5QnCEtCH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
revcli 0.1.5 cannot complete a normal scrape: it crashes after the first ~10 reviews, leaves long reviews cut off, and reports a dead Google session as signed in. This PR fixes findings 1–7 of #31 and adds browser tests that run the in-page code, so this class of regression fails CI.
Refs #31 – the issue stays open until 0.1.6 is published through the release workflow.
Changes
Fixed
scrollDown()passes the scroll step into the page instead of reading a Node-side constant insidepage.evaluate.getSessionState()is the single check for "Google accepts this session" (cookies plus language-independent account / sign-in links).auth statusreports an expired session as not signed in (exit 1);authwaits for a fresh sign-in and closes on its own.AUTH_REQUIREDerror – never retried, one message that says to runrevcli auth, for every sort order. Headed mode asks for sign-in and continues.NOT_A_PLACE. The dead README batch example link is replaced.maps.app.goo.gllinks now redirect in page script, sohl=enwas lost and signed-out or non-English profiles got a localized page. The navigator waits for the destination before forcing English. Found during live verification.--verbose; Playwright call logs are removed from messages, including batch failure lines.Added
src/core/fatal.ts,tests/browser/(scroll, expand, session, navigation against local fixtures, all network blocked),tests/browser-import-guard.test.ts,tests/auth-command.test.ts,tests/fatal.test.ts,tests/selectors.test.ts.npm run test:browser; CI step that installs the Chromium headless shell.release.ymlis not touched.Docs
README.md,AGENTS.md,docs/selector-maintenance.md(current limited view, session markers, expand lesson, "Last verified: 2026-11-17"),CHANGELOG.md([Unreleased]). No version bump.Testing
Automated
npm run typecheck– passnpm test– 419 tests in 25 files pass (297 in 17 before)npm run build,npm run check:pack,npm run test:package– passReferenceError: SCROLL_STEP is not defined; with the old positional expand loop restored, 9 of 10 expand tests failLive, against Google Maps on 2026-11-17 (hl=en, EEA)
auth status: dead session → "expired", exit 1; signed-out → exit 1; valid session → exit 0scrape --headless, all four sort orders: exit 1, one message, 0 retries, 0 stack-trace linesvalidate;batch(invalid line skipped);--resumerevcli authclosing on its own after a real sign-in on a dead session (finding 4), and the headed scrape "ask for sign-in, then continue" path (finding 5). Both need a manual Google sign-in. Covered by automated tests only.Notes
Quality gates
npm auditfails, unchanged by this PR: 10 high, 2 critical. All but one are in dev tooling (vitest,tsupand their dependencies); one high is inzod. This PR changes no dependency. Owner decision: handle the upgrades separately.Accepted tech debt (follow-ups)
batchwith a dead session fails every location separately instead of stopping at the first one.--sort relevant(the Sort sign-in dialog covers the other three sort orders).auth statusfalls back to trusting the cookies ("unconfirmed"), and the sign-in wait ends in its 5-minute timeout.extractor.tsandscraper/auth.tseach hold several responsibilities; a split is deferred.tsxand the built package are covered by live runs..github/workflows/release.yml:282has${{ github.repository }}inside arun:block, against the repo's own invariant. Not touched here.Observed, outside this issue
After merge
Releaseworkflow (bump PR, then publish).https://claude.ai/code/session_01PuLVjZfdZVDn9e5QnCEtCH