Skip to content

Fix crashes, improve scraping resilience, and update UX - #65

Open
OnceUponALoop wants to merge 4 commits into
obeone:mainfrom
OnceUponALoop:fix/skip-none-content-in-individual-export
Open

Fix crashes, improve scraping resilience, and update UX#65
OnceUponALoop wants to merge 4 commits into
obeone:mainfrom
OnceUponALoop:fix/skip-none-content-in-individual-export

Conversation

@OnceUponALoop

Copy link
Copy Markdown
  • Fix TypeError when exporting individual markdown for pages with None content (e.g. failed fetches, non-HTML resources). The other two export methods already had this guard.
  • Add --timeout / -T CLI option for request timeouts. Default is None (no timeout, matching original behavior).
  • Add scraped column to links table to distinguish between pages that were visited vs successfully scraped. Wrap session.get() in try/except so network errors don't crash the scraping loop.
  • Improve progress bar with a second status line showing the current URL being fetched, and ok/err/skip counters tracking outcomes:
    • ok: page successfully scraped
    • err: request failed (timeout, connection error, DNS failure)
    • skip: request succeeded but page unusable (non-200 or non-HTML content type)

@OnceUponALoop
OnceUponALoop marked this pull request as ready for review February 6, 2026 18:30
Add a `scraped` boolean column to the links table to track which pages
were successfully scraped, distinct from the existing `visited` flag.

Wrap session.get() in try/except for RequestException so the scraping
loop continues on network errors instead of crashing. Failed requests
are marked as visited (won't retry) but not scraped, allowing future
flexibility to distinguish between:
- err: request failed (timeout, connection error, DNS failure)
- skip: request succeeded but page unusable (non-200 or non-HTML)
- ok: page successfully scraped
Add a second status line below the progress bar showing the URL
currently being fetched, using tqdm position stacking with a
bare bar_format='{desc}' line.

Track three outcome counters displayed as postfix stats:
- ok: page successfully scraped
- err: request failed (timeout, connection error, DNS failure)
- skip: request succeeded but page unusable (non-200 or non-HTML)

Also moves pbar.update() to after the request completes so the bar
reflects completed work rather than started work.
@OnceUponALoop
OnceUponALoop force-pushed the fix/skip-none-content-in-individual-export branch from 8818ea3 to edeffae Compare February 6, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant