Commit Graph

1480 Commits

Author SHA1 Message Date
Karim shoair d3046dd00a docs: Adding a new sponsor 2026-06-23 18:50:59 +03:00
Karim shoair ea53dced9d docs: update a sponsor 2026-06-23 15:32:00 +03:00
Karim shoair c0f012d662 docs: fixing a typo 2026-06-18 01:01:52 +03:00
Karim shoair 602f72ea60 docs: adding a new sponsor 2026-06-18 00:58:57 +03:00
Karim shoair 149050685e v0.4.9 (#345) 2026-06-07 21:41:55 +03:00
Karim shoair 74c5848060 fix: apply the session-level proxy when no per-request proxy is given
The per-request proxy resolution never fell back to the session default, so FetcherSession(proxy=...) was silently ignored, and requests went direct. Same fix in the sync and async paths, with regression tests asserting on the proxy that reaches curl_cffi.

Closes #295
2026-06-07 18:35:18 +03:00
Karim shoair 5fdb46fea0 docs: updating zensical to the latest version 2026-06-07 18:11:38 +03:00
Karim shoair 061f778434 fix: parse quoted charset values in content-type headers (#323) 2026-06-07 17:58:45 +03:00
Karim shoair 9352ccec3f Merge branch 'dev' into fix/quoted-charset-encoding 2026-06-07 17:58:06 +03:00
Karim shoair b3408c6f3c docs: warn that the default installation doesn't include fetchers
The quickstart examples import from `scrapling.fetchers`, which raises `ModuleNotFoundError` on a bare install since those dependencies live in the fetchers extra. Make the consequence explicit in the installation section across the docs and all README translations.

Closes #343
2026-06-07 16:44:18 +03:00
Karim shoair c732c4ef31 docs: fix broken docs link in CONTRIBUTING file (#320) 2026-06-07 16:25:01 +03:00
Karim shoair c84764d627 Merge branch 'dev' into docs/fix-contributing-docs-link 2026-06-07 16:24:20 +03:00
Karim shoair 4ced6e4ac2 build: pump up version, browsers and deps 2026-06-07 16:16:23 +03:00
Karim shoair 1fd1013806 fix: prevent IndexError in adaptive relocation when auto_save is enabled (#340) 2026-06-07 15:54:34 +03:00
Karim shoair 3d96baf284 Merge branch 'dev' into fix/adaptive-autosave-indexerror 2026-06-07 15:53:47 +03:00
Karim shoair 9c0c857245 fix(parser): use max of both attribute counts in similarity scoring denominator
Candidates with fewer attributes than the original got inflated scores because the denominator counted candidate attributes only, while the extra-attributes penalty direction worked as intended. Using `max()` on both counts fixes the inflation while keeping the penalty.

Closes #322
2026-06-07 15:51:10 +03:00
Karim shoair f7d1e338e0 fix(spiders): use os.replace for atomic checkpoint/cache writes on Windows (#344) 2026-06-07 15:49:33 +03:00
Karim shoair 4f0a593b7d Merge branch 'dev' into fix/atomic-checkpoint-cache-writes 2026-06-07 15:49:01 +03:00
Karim shoair 2b2abb3810 feat: add --version flag to the CLI (#303) 2026-06-07 15:37:41 +03:00
Karim shoair 507f7f626d Merge branch 'dev' into feat/cli-version-flag 2026-06-07 15:37:23 +03:00
Karim shoair 5d839c5995 Merge branch 'main' into dev 2026-06-07 15:37:12 +03:00
Karim shoair fa5f1477d0 Merge branch 'dev' into feat/cli-version-flag 2026-06-07 15:36:58 +03:00
Karim shoair b9bc17b461 docs: removing a sponsor 2026-06-07 15:11:06 +03:00
Ahmed Elshahat f0db3d7d14 fix(spiders): use os.replace for atomic checkpoint/cache writes on Windows
CheckpointManager.save() and ResponseCacheManager.put() write to a temp
file and then move it into place with Path.rename(). On Windows, os.rename
cannot overwrite an existing destination and raises FileExistsError
(WinError 183), so every write after the first one fails: checkpoint
saving raises and breaks resume, while the development response cache
swallows the error and keeps returning the stale entry.

Path.replace() (os.replace) overwrites the destination atomically on every
platform and behaves identically to rename() on POSIX, so this is a no-op
on Linux and macOS and only fixes the broken overwrite on Windows.

Add a regression test for the cache overwrite path; the checkpoint
overwrite is already covered by test_multiple_saves_overwrite.
2026-06-07 04:24:12 +03:00
Karim shoair 141b389cdb docs: updating the support page title 2026-06-04 17:47:40 +03:00
Mubashir Rahim cd4cdc69e6 fix: prevent IndexError in adaptive relocation with auto_save
When `css()`/`xpath()` are called with both `adaptive=True` and
`auto_save=True`, the relocation branch guarded the re-save with
`if elements is not None`. However `relocate()` returns an empty
list (never `None`) when no candidate clears the `percentage`
threshold, so the guard always passed and `self.save(elements[0], ...)`
raised `IndexError: list index out of range`.

This crashes exactly when adaptive resilience is needed most: the page
structure changed enough that nothing matches above the threshold.

Fix: use a truthiness check (`if elements and auto_save`) so the
re-save is skipped when relocation yields nothing. The successful
relocation path (which re-saves the relocated element) is unchanged.

Added a regression test that fails before the fix (IndexError) and
passes after.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 14:53:10 +05:00
Karim shoair 3a2dd29255 docs: update a sponsor 2026-06-03 20:43:40 +03:00
Bortlesboat 6390c0af3d fix: parse quoted charset values in content-type headers
`ResponseFactory.__extract_browser_encoding` matched the charset with
`charset=([\w-]+)`, which stops at a quote character. RFC 7231 permits the
charset value to be a quoted-string (e.g. `content-type: text/html;
charset="ISO-8859-1"`), so for any quoted charset the regex failed to match
and the function silently fell back to the `utf-8` default. A page served as
quoted ISO-8859-1 / windows-1252 / Shift_JIS would then be decoded as UTF-8,
producing mojibake.

Allow an optional surrounding quote in the pattern (`charset=["']?([\w-]+)`)
so the value is captured without the quote. Unquoted headers are unaffected.

The existing `content_type_map` fixture in tests/fetchers/test_utils.py was
unused; add focused tests covering unquoted, quoted, and missing charsets.
2026-06-01 21:30:16 -04:00
Karim shoair 53ef32c723 docs: fix Docker image name in remaining examples (#315) 2026-06-02 02:19:27 +03:00
Karim shoair 6efd50dd17 Merge branch 'dev' into docs/fix-docker-image-name-sweep 2026-06-02 02:17:22 +03:00
Karim shoair 464fba2435 docs: remove a sponsor 2026-06-02 01:39:06 +03:00
Andrew Barnes dbc6817f73 Fix CONTRIBUTING docs link 2026-06-01 09:04:48 -04:00
Evan Alferez 9e43062a63 docs: use pyd4vinci/scrapling in remaining Docker examples (#282)
PR #283 fixed the bare `scrapling` image name in docs/ai/mcp-server.md;
the agent-skill MCP reference and CLI extract docs still used the
unqualified name, which Docker resolves against the official library
namespace and fails with pull access denied.
2026-06-01 09:30:21 +09:00
Karim shoair a6a57eee44 docs: update a sponsor 2026-05-30 15:37:08 +03:00
Karim shoair 961f659ac8 docs: remove old sponsors 2026-05-30 15:30:05 +03:00
ETM-Code c243c8aca5 feat: add --version flag to the CLI
- Add a `--version` flag to the main CLI group using click's `version_option`
- Prints `Scrapling, version <version>` and exits, sourcing the version from `scrapling.__version__`
- Add a CLI test asserting the flag's output

Closes #299
2026-05-30 11:37:22 +01:00
Karim shoair dbd48ffd60 docs: add a new sponsor 2026-05-28 00:53:54 +03:00
Karim shoair b31dc50a06 docs: remove an old sponsor 2026-05-27 04:10:38 +03:00
Karim shoair ed008efcf7 docs: updating a sponsor image 2026-05-18 19:33:49 +03:00
Karim shoair 735af8f221 docs: fix Docker image name in MCP example (#283) 2026-05-16 03:42:13 +03:00
Karim shoair b5d7d3d103 Merge branch 'main' into fix/mcp-docker-image-name 2026-05-16 03:41:48 +03:00
yetval b227583e5f docs: fix Docker image name in MCP example 2026-05-15 09:35:04 -04:00
Karim shoair 6380ef0f26 docs: adding a new sponsor 2026-05-11 15:41:27 +03:00
Karim shoair 9ee35014fe v0.4.8 (#277) 2026-05-11 04:59:43 +03:00
Karim shoair 66d8917013 ops: update tests deps 2026-05-11 04:37:18 +03:00
Karim shoair 149d5f0923 Merge branch 'main' into dev 2026-05-11 04:28:34 +03:00
Karim shoair 55931897d6 docs(agent): update skill zip file 2026-05-11 03:34:17 +03:00
Karim shoair 34651abc6b tests: remove old code and update the rest 2026-05-11 03:30:59 +03:00
Karim shoair ebd7e0971c build: update deps and browser useragents 2026-05-11 03:18:26 +03:00
Karim shoair c0ed8949f6 docs: update zensical version 2026-05-11 03:00:11 +03:00