Scrapist: The Next Level of Efficient Web Scraping
Scrapist is a web scraper designed for Python. This web scraper uses requests and BeautifulSoup and also provides support for Scrapy style CSS selectors. Its features are:
- Faster than requests and BeautifulSoup.
- Is effective in fetching multiple pages compared to Scrapy.
- Provides support for both BeautifulSoup-style selection and Scrapy-style CSS selection.
Installation
To install Scrapist, run this command in the terminal:
pip install scrapist
Initialization
To start web scraping with Scrapist, use this code:
from scrapist import Scraper
scraper = Scraper()
data = scraper.scrape("<your url here>")
print(data.soup)
Getting Specified Parts/Tags of a web page
To get specified parts/tags of a web page, you can choose either of the two ways:
The Scrapy-style
To get specified data Scrapy-style, use this code after the initialization:
first = data.css("<your css selector here>").get()
print(first)
# Or
all_data = data.css("<your css selector here>").getall()
print(all_data)
The BeautifulSoup-style
To get specified data BeautifulSoup-style, use this code after the initialization:
first = data.find("<your tag here>", "[your attributes here]")
print(first)
# Or
all_data = data.find_all("<your tag here>", "[your attributes here]")
print(all_data)
Creating a Soup Strainer
To create a soup strainer, use this code just after the line of creating a scraper (The scraper = Scraper() intialization line):
strainer = scraper.strainer("<your tag here>", "[your attribute here]")
And use the strainer in the strainer parameter in scraper.scrape() function.
Metadata
Release files for scrapist 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scrapist-1.0.0.tar.gz | 4.2 kB | Without provenance | Details for scrapist-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scrapist-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for scrapist-1.0.0-py3-none-any.whl |
Total release size: 9.4 kB
Release files / scrapist-1.0.0.tar.gz
| Download URL | scrapist-1.0.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32192186ebb78d11c7150f58983f27f4e052693ce0ec90e2fb748c28da2b8ac5
|
|
BLAKE2b-256 checksum How to use checksums |
fb9c695aae5dbf048ad5bd478a2aa415d29e91e61aa290e51a0b0747cb8f834a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.6
|
Release files / scrapist-1.0.0-py3-none-any.whl
| Download URL | scrapist-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00ed5e6723d138cbe8d51f5d1dbc77d06479dcd1cb702525ed323b0766cb0088
|
|
BLAKE2b-256 checksum How to use checksums |
94ac8cb3fafc520c9f2e4b14b919303190406b97898b5507568747ce92dfd546
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.6
|
Security for scrapist 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.