Merge pull request #43 from D4Vinci/dev

v0.2.96
This commit is contained in:
Karim shoair
2025-03-05 03:43:19 +02:00
committed by GitHub
6 changed files with 9 additions and 19 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Adaptive Web Scraping for Python
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Easy Web Scraping with Python
[![Tests](https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml/badge.svg)](https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml) [![PyPI version](https://badge.fury.io/py/Scrapling.svg)](https://badge.fury.io/py/Scrapling) [![Supported Python versions](https://img.shields.io/pypi/pyversions/scrapling.svg)](https://pypi.org/project/scrapling/) [![PyPI Downloads](https://static.pepy.tech/badge/scrapling)](https://pepy.tech/project/scrapling)
Dealing with failing web scrapers due to anti-bot protections or website changes? Meet Scrapling.
+1 -1
View File
@@ -5,7 +5,7 @@ from scrapling.fetchers import (AsyncFetcher, CustomFetcher, Fetcher,
from scrapling.parser import Adaptor, Adaptors
__author__ = "Karim Shoair (karim.shoair@pm.me)"
__version__ = "0.2.95"
__version__ = "0.2.96"
__copyright__ = "Copyright (c) 2024 Karim Shoair"
+4 -3
View File
@@ -12,13 +12,14 @@ def get_package_dir():
def run_command(command, line):
print(f"Installing {line}...")
_ = subprocess.check_call(command, shell=True)
_ = subprocess.check_call(' '.join(command), shell=True)
# I meant to not use try except here
@click.command(help="Install all Scrapling's Fetchers dependencies")
def install():
if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
@click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
def install(force):
if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')
+1 -12
View File
@@ -23,19 +23,8 @@ class TextHandler(str):
return super().__new__(cls, string)
return super().__new__(cls, '')
@typing.overload
def __getitem__(self, key: SupportsIndex) -> 'TextHandler':
pass
@typing.overload
def __getitem__(self, key: slice) -> "TextHandlers":
pass
def __getitem__(self, key: Union[SupportsIndex, slice]) -> Union["TextHandler", "TextHandlers"]:
def __getitem__(self, key: Union[SupportsIndex, slice]) -> "TextHandler":
lst = super().__getitem__(key)
if isinstance(key, slice):
lst = [TextHandler(s) for s in lst]
return TextHandlers(typing.cast(List[_TextHandlerType], lst))
return typing.cast(_TextHandlerType, TextHandler(lst))
def split(self, sep: str = None, maxsplit: SupportsIndex = -1) -> 'TextHandlers':
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata]
name = scrapling
version = 0.2.95
version = 0.2.96
author = Karim Shoair
author_email = karim.shoair@pm.me
description = Scrapling is an undetectable, powerful, flexible, high-performance Python library that makes Web Scraping easy again!
+1 -1
View File
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup(
name="scrapling",
version="0.2.95",
version="0.2.96",
description="""Scrapling is an undetectable, powerful, flexible, high-performance Python library that makes Web Scraping easy again! In an internet filled with complications,
it simplifies web scraping, even when websites' design changes, while providing impressive speed that surpasses almost all alternatives.""",
long_description=long_description,