Commit Graph

1266 Commits

Author SHA1 Message Date
Karim shoair 17ea982162 fix(fetchers): add max retry limit to _get_page_content to prevent infinite loop (#197) 2026-03-17 22:09:05 +02:00
Karim shoair 8e4e59e13e Merge branch 'dev' into fix/page-content-infinite-loop 2026-03-17 22:08:47 +02:00
Karim shoair d9932f2308 fix(spider/fetcher): preserve HTTP method across retries in spider session (#201) 2026-03-17 22:06:01 +02:00
Karim shoair 4c07b294ae Merge branch 'dev' into fix/preserve-http-method-on-retry 2026-03-17 22:04:57 +02:00
Karim shoair 27f306259e Merge branch 'dev' into fix/page-content-infinite-loop 2026-03-17 21:55:26 +02:00
Karim shoair 136c389787 fix(Texthandler): Replace get_all with getall to match the Selector class 2026-03-17 21:53:17 +02:00
Karim shoair 980be18a2a test: add coverage for TextHandler regex paths and TextHandlers.re() (#194) 2026-03-17 21:50:05 +02:00
Karim shoair 5123590a15 Merge branch 'dev' into test/custom-types-coverage 2026-03-17 21:42:17 +02:00
Karim shoair cc6c0dbfb9 fix: adjust test to the _restore_from_checkpoint fix 2026-03-17 17:46:47 +02:00
Karim shoair 1fb7961d42 fix: replace bare raise with return False in _restore_from_checkpoint (#196) 2026-03-17 17:45:52 +02:00
Karim shoair bcd45e47bb Merge branch 'dev' into fix/checkpoint-restore-bare-raise 2026-03-17 17:36:11 +02:00
Karim shoair 5eefbc6c05 Merge branch 'dev' into test/custom-types-coverage 2026-03-17 17:34:12 +02:00
Karim shoair 440da11259 Merge branch 'main' into dev 2026-03-17 17:28:38 +02:00
Karim shoair 7bfaf204b7 docs: CJK Latin spacing fixes for the JP README 2026-03-17 17:12:41 +02:00
Karim shoair 74abd54a0b docs: Add translations to the new sponsor 2026-03-17 17:00:32 +02:00
Karim shoair 3d60792cbc docs: update Zensical 2026-03-17 16:53:55 +02:00
Karim shoair 3b543a6bdd docs: add a new sponsor 2026-03-17 16:45:04 +02:00
karesansui 5bf921b308 fix: preserve HTTP method across retries in spider session
SessionManager.fetch() pops `method` from `_session_kwargs`,
which mutates the original request dict. When the engine retries
a blocked request via request.copy(), the copy no longer has
`method`, so it defaults to GET.

Steps to reproduce:
1. Yield Request(url, method="POST", data=...)
2. Target returns a response that triggers is_blocked()
3. Engine retries via request.copy() → second fetch uses GET

Fix: copy the kwargs dict before popping, so the original
request stays intact.
2026-03-17 00:53:52 +09:00
Karim shoair 012e9f9f5e docs: images adjustments 2026-03-16 16:23:08 +02:00
Karim shoair f25bca75bf docs: fixing broken links
Also, Fixes #199
2026-03-16 15:38:23 +02:00
Karim shoair ca6c1f3c1e docs: CJK Latin spacing fixes for the Chinese README 2026-03-16 15:26:25 +02:00
Karim shoair 72a2c8de81 Merge branch 'main' into dev 2026-03-15 22:44:16 +02:00
Karim shoair eb32285c49 docs: add the sponsor translated versions 2026-03-15 22:25:50 +02:00
Karim shoair f286575f31 docs: adding a new sponsor 2026-03-15 22:17:12 +02:00
Karim shoair 1e7704864e Merge branch 'dev' into test/custom-types-coverage 2026-03-15 16:38:48 +02:00
Karim shoair e63e57e6dc test(ai): add _normalize_credentials edge case coverage (#192) 2026-03-15 16:25:57 +02:00
Karim shoair 656dbc7d12 Merge branch 'dev' into test/normalize-credentials-coverage 2026-03-15 16:24:59 +02:00
haosenwang1018 d3c251c1ab fix: add max retry limit to _get_page_content to prevent infinite loop
Both _get_page_content and _get_async_page_content use a while-True
loop that retries page.content() on PlaywrightError with no upper
bound. If the page is in a permanently broken state (crashed tab,
closed context), this loops forever and hangs the process.

Replace with a bounded for-loop (default 10 retries = 5s), returning
an empty string if all attempts fail. This preserves the existing
retry behavior for the transient Windows issue (playwright#16108)
while preventing hangs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:53:23 +08:00
haosenwang1018 a31763afde fix: replace bare raise with return False in _restore_from_checkpoint
When _checkpoint_system_enabled is False, the method uses a bare
`raise` with no active exception, which causes RuntimeError at
runtime. The method's docstring says it returns False when restoration
is not possible, so return False is the correct behavior.

The caller in crawl() currently guards with `if
self._checkpoint_system_enabled`, but the method's own contract
should be self-consistent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:52:57 +08:00
haosenwang1018 7178279586 test: add coverage for TextHandler regex, clean, and TextHandlers.re()
Several critical code paths in custom_types.py lacked test coverage:

- TextHandler.re(check_match=True): returns bool, not TextHandlers
- TextHandler.re(replace_entities=False): entity preservation path
- TextHandler.re() with capture groups: flatten behavior
- TextHandler.re_first() default value when no match
- TextHandler.clean(remove_entities=True): entity replacement path
- TextHandler.json() valid and invalid input
- TextHandlers.re(): list-level regex with result flattening
- TextHandlers.extract()/get_all(): identity return

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:27:55 +08:00
Andrew Barnes 54fcb7c364 test(ai): add _normalize_credentials edge case coverage 2026-03-15 00:14:54 -04:00
Karim shoair c7f0db912c docs: move up a new sponsor 2026-03-14 17:08:51 +02:00
Karim shoair 184ba6d0b0 docs: Add Korean (한국어) README translation (#187) 2026-03-11 16:49:52 +02:00
gk 60243a823a docs: Add Korean (한국어) README translation 2026-03-11 14:33:58 +09:00
Karim shoair 3836712939 docs: adjustments 2026-03-11 06:13:30 +02:00
Karim shoair 50388bf675 docs: update sponsors page 2026-03-11 05:54:54 +02:00
Karim shoair d67a397ecc docs: add the sponsor to the translated README files 2026-03-11 05:47:32 +02:00
Karim shoair 569e317437 docs: add new sponsor 2026-03-11 05:42:18 +02:00
Karim shoair 79a03ae7f0 docs: move up a sponsor 2026-03-11 01:11:19 +02:00
Karim shoair 1aa150f090 docs: replace the downloads badge 2026-03-11 00:06:05 +02:00
Karim shoair 19c21c17ee v0.4.2 (#183) 2026-03-09 01:37:28 +02:00
Karim shoair 6ec40ad19d docs: remove a sponsor 2026-03-09 00:48:15 +02:00
Karim shoair f80743a97b style: remove unused import 2026-03-09 00:35:06 +02:00
Karim shoair 66e0e7af57 fix(agent): update the agent skill zip file with the new version 2026-03-09 00:31:57 +02:00
Karim shoair 73832f9dfe docs: update the website to reflect the google referer logic 2026-03-09 00:29:54 +02:00
Karim shoair d48ac78c79 test: update tests accordingly 2026-03-09 00:28:32 +02:00
Karim shoair 8e3bf89e6c fix(agent): update the agent skills docs and version 2026-03-09 00:27:10 +02:00
Karim shoair a929de6ca4 fix: update code and docstrings to remove the old google referer logic 2026-03-09 00:25:19 +02:00
Karim shoair b547e04207 ops: update playwright pinned version 2026-03-09 00:05:46 +02:00
Karim shoair 27409927a3 build: pump up deps and browsers versions 2026-03-08 23:57:10 +02:00