@@ -1,4 +1,4 @@
|
||||
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Adaptive Web Scraping for Python
|
||||
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Easy Web Scraping with Python
|
||||
[](https://github.com/D4Vinci/Scrapling/actions/workflows/tests.yml) [](https://badge.fury.io/py/Scrapling) [](https://pypi.org/project/scrapling/) [](https://pepy.tech/project/scrapling)
|
||||
|
||||
Dealing with failing web scrapers due to anti-bot protections or website changes? Meet Scrapling.
|
||||
|
||||
@@ -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
@@ -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')
|
||||
|
||||
@@ -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,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!
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user