Commit Graph

1400 Commits

Author SHA1 Message Date
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
awanawona cec5acd68a test: add edge case tests for filter, iterancestors, and find_similar
- test_selectors_filter.py: covers chained filter(), empty result,
  all-pass predicate, and calling filter() on empty Selectors
- test_ancestor_navigation.py: covers iterancestors() order, depth,
  text-node safety, root-element edge case, and find_ancestor() with
  no match
- test_find_similar_advanced.py: covers similarity_threshold levels,
  match_text=True behavior, ignore_attributes combinations, and
  text-node safety
2026-03-16 18:01:11 +08: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
haosenwang1018 297423410d test: add save/retrieve round-trip and hash/URL coverage for storage core
The adaptive scraping feature relies on SQLiteStorageSystem to persist
and relocate elements, but the existing tests only verified object
creation — not the actual save/retrieve workflow. This adds:

- _get_base_url: None, empty, valid URL, and case-normalization paths
- _get_hash: determinism, uniqueness, strip/lowercase, length suffix
- save/retrieve round-trip: basic, overwrite (upsert), nonexistent key
- URL-based isolation between different websites
- element_to_dict: with/without text, attributes, whitespace filtering
- _get_element_path: nested and root element paths
- Thread safety: 20 concurrent saves with result verification

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:27:10 +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
Karim shoair aa6f96eb67 fix: return bare Google URL in referer instead of search query (#179)
Solves #172
2026-03-08 23:20:43 +02:00
Karim shoair b0c8448f81 Merge branch 'dev' into fix/google-referrer-spoof 2026-03-08 19:01:20 +02:00
Karim shoair 11bc08fbaa fix: Selector.get_all_text() doesn't get all text #167 (#168)
Fixes #167
2026-03-08 19:01:04 +02:00
Andrew Barnes 68b9e128bc fix: return bare Google URL in referer instead of search query
Real browsers send `https://www.google.com/` as the Referer header
when clicking search results, not the full search URL with query
parameters. The previous format was a fingerprinting signal that
the referer was spoofed.

Closes #172
2026-03-08 11:32:04 -04:00
Matt Hillebrand 7cbe566acd Move test for get_all_text to test_parser_advanced.py 2026-03-08 08:20:30 -07:00
Karim shoair e045d0f73f Merge branch 'dev' into dev 2026-03-08 16:31:25 +02:00
Karim shoair 49db2b643b Merge branch 'main' into dev 2026-03-08 16:27:25 +02:00
Karim shoair b9b5bb0c80 docs: add badges for the agent skill and Clawhub 2026-03-08 06:56:50 +02:00
Karim shoair 68e6c3c3e8 docs: adjustments 2026-03-08 06:39:49 +02:00
Karim shoair d1a0b815f5 docs: update translation files with new sponsor 2026-03-08 06:27:04 +02:00
Karim shoair cb7e9b9ef3 docs: add new platinum sponsor 2026-03-08 06:16:48 +02:00
Karim shoair 25de97f534 docs: update the agent skill readme 2026-03-08 03:30:04 +02:00
Karim shoair 68da2af556 docs: update the agent skill readme 2026-03-08 03:21:23 +02:00
Matt Hillebrand 00ad6b4c5f Add two ignored elements to unit test 2026-03-07 17:11:39 -08:00
Matt Hillebrand 5806b8e014 - Add pre-compiled XPath text selector
- Avoid recursion
2026-03-07 17:11:39 -08:00
Matt Hillebrand 5457a697fa fix: Selector.get_all_text() doesn't get all text #167
- Updated text extraction using recursion
- Added new unit test
2026-03-07 17:11:39 -08:00