Commit Graph
100 Commits
Author SHA1 Message Date
Karim shoair b503f537ce docs: corrections to the sponsorship page 2026-02-23 03:49:16 +02:00
Karim shoair a0cc3857d0 docs: corrections to the sponsorship page 2026-02-23 03:27:43 +02:00
Karim shoair aed842c42e docs: update sponsorship plans 2026-02-23 03:25:18 +02:00
Karim shoair f537613921 docs: shortening the demo code in the README 2026-02-23 03:04:27 +02:00
Karim shoair a6beaaba89 docs: adjustments to sponsors placement 2026-02-23 02:58:25 +02:00
Karim shoair 4072c5e83d docs: update readme URLs 2026-02-23 02:45:37 +02:00
Karim shoair 1f5a7d5d2c ops: add mcp registry file 2026-02-23 02:31:28 +02:00
Karim shoair 2b56a87e36 Merge branch 'main' into dev 2026-02-18 04:47:32 +02:00
Karim shoair cd13a695cb docs: adjustments to website metadata 2026-02-18 04:33:39 +02:00
Karim shoair a9b785aa8f docs: add media preview image 2026-02-18 04:26:09 +02:00
Karim shoair 60eea3ba68 docs: add media preview image 2026-02-18 00:04:53 +02:00
Karim shoair f21e7462e4 docs: fix cookie consent 2026-02-15 15:11:48 +02:00
Karim shoair 1bbb18ad8e build: fix readme path for pypi 2026-02-15 07:16:28 +02:00
Karim shoair 04d796b821 v0.4 2026-02-15 07:13:28 +02:00
Karim shoair 95ad2842e9 docs: add an entry for the 0.4 version 2026-02-15 04:40:43 +02:00
Karim shoair b19fa5e694 fix(checkpoint): correct error message 2026-02-15 04:36:43 +02:00
Karim shoair e35ba3455c test: add tests for spiders engine
Automated tests written by AI
2026-02-15 04:35:28 +02:00
Karim shoair 02b11c535e fix(spiders): corrections and removal of dead code 2026-02-15 04:25:32 +02:00
Karim shoair b8b9a7f864 docs: general correction across all the pages
Automated. I don't know how I missed all of that!
2026-02-15 03:58:51 +02:00
Karim shoair 93bcb1681b style: docstrings corrections for accuracy 2026-02-15 03:57:14 +02:00
Karim shoair 1bf6bb8d65 docs: update the images urls to use main branch 2026-02-15 03:29:57 +02:00
Karim shoair 7b8fc911e1 docs: add a page for spiders advanced usage 2026-02-15 02:40:55 +02:00
Karim shoair 7b4523af8e docs: update the titles for all files 2026-02-15 02:35:39 +02:00
Karim shoair c3374bce41 docs: add a note about response body 2026-02-15 01:03:36 +02:00
Karim shoair ba4d33337f fix: make browser fetchers type hints always present 2026-02-15 01:03:15 +02:00
Karim shoair 77e825e7be docs(spider): add a new page for proxy management & blocking 2026-02-15 01:01:43 +02:00
Karim shoair dee0fd00b8 docs: use more accurate naming for proxy rotation strategy 2026-02-14 23:21:08 +02:00
Karim shoair 0ab54852c4 fix: use more accurate naming for proxy rotation strategy
It can be considered the simplest form of round robin since we don't have weights or anything (as was originally planned), but let's change it to avoid confusion or useless debates. Here goes nothing
2026-02-14 23:19:54 +02:00
Karim shoair c94ebd2fa9 docs(spiders): add a page to explain sessions logic 2026-02-14 17:19:55 +02:00
Karim shoair 108e11fc30 docs: add a new issue template for documentation issues 2026-02-14 17:08:32 +02:00
Karim shoair dddb179c50 docs: add new api references 2026-02-14 17:07:55 +02:00
Karim shoair a8f701f8ab docs(spiders): add a new page for requests & responses 2026-02-14 04:04:18 +02:00
Karim shoair 2997d562d5 test: remove irrelevent test 2026-02-14 03:34:41 +02:00
Karim shoair e785cf26ce fix(parser)!: Optimize parser for repeated operations 2026-02-14 03:34:13 +02:00
Karim shoair d0a5a01299 test: update spider check 2026-02-14 02:51:39 +02:00
Karim shoair 6a0c323482 docs: adding a new Pick Your Path section to the overview page 2026-02-14 00:43:05 +02:00
Karim shoair c6a662eb38 docs(dynamic pages): add an important warning 2026-02-13 18:45:44 +02:00
Karim shoair 2eea66dad1 style(spiders): Lower the default number of concurrent requests 2026-02-13 17:32:17 +02:00
Karim shoair a62330d2f1 fix: add typed overloads to Selectors.get() for proper default type inference
Type checkers now correctly infer the return type based on the default value:
- .get() → TextHandler | None
- .get("") → TextHandler | str
- .get(0) → TextHandler | int
2026-02-13 17:30:55 +02:00
Karim shoair 1c2c7c55bf docs: use a better looking architecture image instead of mermaid 2026-02-12 15:17:58 +02:00
Karim shoair 14143dd0f0 docs: add getting started page to the spiders section 2026-02-12 04:45:39 +02:00
Karim shoair bbb8c26df0 docs: Improve spider architecture page 2026-02-12 04:30:16 +02:00
Karim shoair d0b2cec849 docs: simplify the architecture mermaid 2026-02-12 03:30:14 +02:00
Karim shoair 5a599445e2 docs: update libraries 2026-02-12 03:29:41 +02:00
Karim shoair 10cd46ee23 docs: add the first page of the spiders section 2026-02-11 03:55:23 +02:00
Karim shoair 8902034418 docs: improve wording, style, and use more visual ways 2026-02-11 03:04:35 +02:00
Karim shoair 6ac40ac3af build: adjustments to build file for PyPi 2026-02-11 00:29:20 +02:00
Karim shoair a38f5af615 docs: fix image in the interactive shell page 2026-02-11 00:19:38 +02:00
Karim shoair b52d35c6ec docs: update beautifulsoup migration guide 2026-02-10 22:13:04 +02:00
Karim shoair 8e4b4a22c9 docs: updating extract commans page 2026-02-10 22:09:55 +02:00
Karim shoair 7fb57d667c docs: updating Interactive shell page and some corrections 2026-02-10 22:07:55 +02:00
Karim shoair a72886f158 docs: update camoufox instructions for StealthyFetcher 2026-02-10 21:58:08 +02:00
Karim shoair d4766a070b build: update the website description 2026-02-10 21:54:17 +02:00
Karim shoair 0489923b06 build: pump up the version status 2026-02-10 21:53:00 +02:00
Karim shoair d3ee9a6cbb ops: remove branch v4 from workflows 2026-02-10 21:51:22 +02:00
Karim shoair 2dbd402000 docs: update links to use the current branch 2026-02-10 21:51:02 +02:00
Karim shoair f350800fd7 docs: updating Dynamic websites with protection page and some corrections 2026-02-10 21:48:09 +02:00
Karim shoair dba3e9d53e docs: updating dynamic websites page and some corrections 2026-02-10 21:23:14 +02:00
Karim shoair 8b1704a87e docs: use better import for ProxyRotator class 2026-02-10 21:20:43 +02:00
Karim shoair 4e3829fced style: expose ProxyRotator class to the public API 2026-02-10 21:20:07 +02:00
Karim shoair 8df74dc57b docs: updating http requests page and some corrections 2026-02-10 19:07:09 +02:00
Karim shoair f25fe64d3c docs: updating fetcher choosing page and some corrections 2026-02-10 19:01:50 +02:00
Karim shoair 87b99a407b docs: updating adaptive page and some corrections 2026-02-10 19:00:36 +02:00
Karim shoair 11bd4e4295 docs: updating main classes page and some corrections 2026-02-10 18:58:58 +02:00
Karim shoair 44e2c42eaf docs: updating selection page and some corrections 2026-02-10 18:42:37 +02:00
Karim shoair 989fdca201 docs: updating benchmarks page 2026-02-10 18:28:23 +02:00
Karim shoair a5abf1f3ba docs: updating overview page and some corrections 2026-02-10 18:25:31 +02:00
Karim shoair 8505c4a91c docs: possible fix for RTD zensical build 2026-02-09 01:50:22 +02:00
Karim shoair 33eb2ff56b docs: possible fix for RTD zensical build 2026-02-09 01:41:50 +02:00
Karim shoair 9b46cb35ab docs: possible fix for RTD zensical build 2026-02-09 01:16:04 +02:00
Karim shoair dc071ee6b8 docs: possible fix for RTD zensical build 2026-02-09 01:10:00 +02:00
Karim shoair 8ed71e4864 V4 (#130) 2026-02-09 00:55:21 +02:00
Karim shoair e688093974 docs: update the translated readme files with the new content 2026-02-09 00:46:58 +02:00
Karim shoair 3dc4bdcb4a docs: small adjustments to the readme file 2026-02-09 00:36:52 +02:00
Karim shoair 2a4d008927 docs: full update for main readme 2026-02-09 00:28:24 +02:00
Karim shoair 1f9eb17414 ops: update benchmarks script 2026-02-08 23:33:30 +02:00
Karim shoair 0c86d70307 docs: update the website main page 2026-02-08 23:33:10 +02:00
Karim shoair ca46070a1b docs: Improve README.md description formatting
Reformatted the description of Scrapling for clarity and readability.
2026-02-08 22:43:00 +02:00
Karim shoair 8d82d3c90d docs: update readme file 2026-02-08 22:39:50 +02:00
Karim shoair 9a108160c2 docs: move translated README files to docs folder again 2026-02-08 22:18:36 +02:00
Karim shoair 12b731b14b docs: move readme files to the root directory 2026-02-08 21:04:15 +02:00
Karim shoair 09cd5e6183 docs(readme): update translation links 2026-02-08 20:54:26 +02:00
Karim shoair 2ae11d21da docs: full switch from mkdocs to zensical 2026-02-08 20:46:38 +02:00
Karim shoair db41a6c4b6 docs: update pages with the new media for testing zensical 2026-02-08 20:46:14 +02:00
Karim shoair 0e2e9fb2ed docs: moving readme files to be outside of the website build 2026-02-08 20:45:03 +02:00
Karim shoair 219db79195 docs: update logo and media 2026-02-08 20:44:04 +02:00
Karim shoair 3eaa7ffc25 ops: exclude site directory from git 2026-02-08 20:42:35 +02:00
Karim shoair b1ce0b414b ops: Add mypy and pyright to the code quality workflow 2026-02-07 17:28:44 +02:00
Karim shoair 16852cb1ac style: Use shorter and more accurate naming for constants 2026-02-07 16:37:47 +02:00
Karim shoair ec7c7f8153 Merge branch 'main' into v4 2026-02-07 16:30:37 +02:00
Karim shoair e777342741 build: pump up version and deps 2026-02-07 16:30:32 +02:00
Karim shoair 5ec929435b style: Fix all mypy errors and add type hints to untyped function bodies
**Resolved all 65 mypy errors across 14 files and added type annotations to all previously untyped function bodies. Final result: 0 errors with --check-untyped-defs enabled, all 454 tests pass.**

`scrapling/core/_types.py`

  - Removed broken Self = object fallback — now requires typing_extensions for Python < 3.11

`scrapling/core/storage.py`

  - Fixed str/bytes mismatch in _get_hash() — used separate _identifier_bytes variable instead of reassigning from str to bytes

`scrapling/core/custom_types.py`

  - split() return type: Union[List, "TextHandlers"] → list[Any] (avoids LSP violation with parent list[str])
  - format() kwargs: **kwargs: str → **kwargs: object (matches parent str.format signature)
  - AttributesHandler.__init__: Added mapping: Any = None, **kwargs: Any and -> None
  - json_string property: Added -> bytes return type

`scrapling/core/mixins.py`

  - Changed self: "Selector" to self: Any on all mixin methods (mypy can't handle forward-reference self types on non-subclass mixins)
  - Added Dict[str, int] annotation for counter variable
  - Removed unused TYPE_CHECKING / Selector imports

`scrapling/parser.py (~30 errors)`

  - Added body: str | bytes pre-annotation for dual-type if/elif assignment
  - Used Dict[str, Any] kwargs dict for HTMLParser(...) to bypass incomplete lxml stubs missing default_doctype
  - Changed base_url=url or None → base_url=url or "" (avoids str | None vs str | bytes)
  - bool(adaptive) to guarantee bool type for __adaptive_enabled
  - Declared __text: Optional[TextHandler], __tag: Optional[str], __attributes: Optional[AttributesHandler] at top of __init__
  - cast(List, ...) for all XPath() call results (_find_all_elements, _find_all_elements_with_spaces)
  - Added Dict[float, List[Any]] for score_table, Dict[str, Any] for attributes
  - Changed score, checks = 0, 0 → score: float = 0; checks: int = 0 (two locations)
  - Renamed target → target_element in save() to avoid variable redefinition with different types
  - Wrapped node_text.clean() / .lower() in TextHandler(...) to preserve type

`scrapling/engines/_browsers/_page.py`

  - Added PageInfo[SyncPage] | PageInfo[AsyncPage] union type annotation to page_info variable

`scrapling/engines/_browsers/_validators.py`

  - Convert method_kwargs (TypedDict) to plain Dict[str, Any] before dynamic key access

`scrapling/engines/_browsers/_base.py`

  - Added _config declaration to BaseSessionMixin
  - Used cast(StealthConfig, self._config) in __generate_stealth_options to access stealth-only attributes
  - Added Tuple[str, ...] annotation for flags
  - Removed redundant narrower StealthConfig type annotation on self._config in StealthySessionMixin.__validate__
  - Widened SyncSession and AsyncSession fields (playwright, context, browser) to Any to support both playwright and patchright types
  - Added -> None to both start() methods

`scrapling/engines/_browsers/_stealth.py`

  - Added Optional, ProxyType imports
  - Annotated proxy: Optional[ProxyType] in both sync/async fetch loops
  - Annotated outer_box: Any at first declaration, removed duplicate type annotations in subsequent branches
  - Added -> None to sync and async start()
  - Added config: Any parameter type to _initialize_context
  - Removed redundant self.context: AsyncBrowserContext re-annotations in conditional branches

`scrapling/engines/_browsers/_controllers.py`

  - Added Optional, ProxyType imports
  - Annotated proxy: Optional[ProxyType] in both sync/async fetch loops
  - Added -> None to async start()
  - Removed redundant self.context: AsyncBrowserContext re-annotations

`scrapling/spiders/request.py`

  - Added Optional import, typed _fp: Optional[bytes] = None
  - Removed redundant body: bytes re-annotation

`scrapling/spiders/session.py`

  - Used separate client variable instead of reassigning session = session._client (avoids type incompatibility and fixes a bug where session._make_request was called instead of client._make_request)
  - Added -> None to SessionManager.__init__

`scrapling/engines/toolbelt/convertor.py`

  - Added list[Response] annotation for history in both sync/async methods

`scrapling/engines/static.py`

  - FetcherClient.__init__ and AsyncFetcherClient.__init__: Added **kwargs: Any and -> None

`scrapling/core/shell.py`

  - Wrapped re_sub(...) result in TextHandler(...) to maintain correct type
  - Added -> None to CurlParser.__init__
  - Added full type signature to create_wrapper, replaced wrapper.__signature__ = ... with setattr(wrapper, "__signature__", ...) to satisfy mypy
  - Added Callable to imports
2026-02-07 16:30:00 +02:00
Karim shoair 5f557a7f9f test: add tests for the new feature 2026-02-07 01:28:58 +02:00
Karim shoair 66476d42be feat(browsers): Add option to block requests to specific domains 2026-02-07 01:26:21 +02:00
Karim shoair d00c34ee7f style(parser): Improve the type hint for find_by_text and find_by_regex 2026-02-06 03:19:00 +02:00
Karim shoair 05f62fba81 fix(response): Force the body of the response to always be bytes 2026-02-06 03:14:23 +02:00
Karim shoair 9acc8194c5 test: update the tests accordingly 2026-02-06 02:45:13 +02:00
Karim shoair aa7a95fb70 feat(parser)!: Make all selection return selector objects by default
- The strings/Texthandlers are only returned by `get`/`getall`/`extract`/`extract_first`. This makes the type checking/autocompletion experience consistent.
- Removed `css_first` and `xpath_first` since it doesn't make sense to leave them now.
- Made the type hints more accurate in multiple places.
2026-02-06 02:43:51 +02:00
Karim shoair d8fe909c8b docs: make translation urls absolute
For PyPI, Docker, and other external websites featuring this
2026-02-05 02:44:12 +02:00
Karim shoair 151e4e7a7c docs: adding new sponsor 2026-02-05 02:39:51 +02:00