Skip to content

Commit 3ca4ea1

Browse files
authored
Merge pull request #43 from D4Vinci/dev
v0.2.96
2 parents 573bfe0 + f8662be commit 3ca4ea1

6 files changed

Lines changed: 9 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Adaptive Web Scraping for Python
1+
# 🕷️ Scrapling: Undetectable, Lightning-Fast, and Easy Web Scraping with Python
22
[![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)
33

44
Dealing with failing web scrapers due to anti-bot protections or website changes? Meet Scrapling.

scrapling/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from scrapling.parser import Adaptor, Adaptors
66

77
__author__ = "Karim Shoair ([email protected])"
8-
__version__ = "0.2.95"
8+
__version__ = "0.2.96"
99
__copyright__ = "Copyright (c) 2024 Karim Shoair"
1010

1111

scrapling/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ def get_package_dir():
1212

1313
def run_command(command, line):
1414
print(f"Installing {line}...")
15-
_ = subprocess.check_call(command, shell=True)
15+
_ = subprocess.check_call(' '.join(command), shell=True)
1616
# I meant to not use try except here
1717

1818

1919
@click.command(help="Install all Scrapling's Fetchers dependencies")
20-
def install():
21-
if not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
20+
@click.option('-f', '--force', 'force', is_flag=True, default=False, type=bool, help="Force Scrapling to reinstall all Fetchers dependencies")
21+
def install(force):
22+
if force or not get_package_dir().joinpath(".scrapling_dependencies_installed").exists():
2223
run_command([sys.executable, "-m", "playwright", "install", 'chromium'], 'Playwright browsers')
2324
run_command([sys.executable, "-m", "playwright", "install-deps", 'chromium', 'firefox'], 'Playwright dependencies')
2425
run_command([sys.executable, "-m", "camoufox", "fetch", '--browserforge'], 'Camoufox browser and databases')

scrapling/core/custom_types.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,8 @@ def __new__(cls, string):
2323
return super().__new__(cls, string)
2424
return super().__new__(cls, '')
2525

26-
@typing.overload
27-
def __getitem__(self, key: SupportsIndex) -> 'TextHandler':
28-
pass
29-
30-
@typing.overload
31-
def __getitem__(self, key: slice) -> "TextHandlers":
32-
pass
33-
34-
def __getitem__(self, key: Union[SupportsIndex, slice]) -> Union["TextHandler", "TextHandlers"]:
26+
def __getitem__(self, key: Union[SupportsIndex, slice]) -> "TextHandler":
3527
lst = super().__getitem__(key)
36-
if isinstance(key, slice):
37-
lst = [TextHandler(s) for s in lst]
38-
return TextHandlers(typing.cast(List[_TextHandlerType], lst))
3928
return typing.cast(_TextHandlerType, TextHandler(lst))
4029

4130
def split(self, sep: str = None, maxsplit: SupportsIndex = -1) -> 'TextHandlers':

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = scrapling
3-
version = 0.2.95
3+
version = 0.2.96
44
author = Karim Shoair
55
author_email = [email protected]
66
description = Scrapling is an undetectable, powerful, flexible, high-performance Python library that makes Web Scraping easy again!

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="scrapling",
9-
version="0.2.95",
9+
version="0.2.96",
1010
description="""Scrapling is an undetectable, powerful, flexible, high-performance Python library that makes Web Scraping easy again! In an internet filled with complications,
1111
it simplifies web scraping, even when websites' design changes, while providing impressive speed that surpasses almost all alternatives.""",
1212
long_description=long_description,

0 commit comments

Comments
 (0)