A fast web scraping library
Project description
Try Web Scraping
To get started, run: pip install trywebscraping
Here's some example code to help you begin:
from trywebscraping import Fetch
hn = Fetch("https://news.ycombinator.com")
articles = hn.query("tr.athing").extract({
"rank": "span.rank",
"title": "td.title a",
"link": "td.title a@href"
}).limit(10)
print(articles)
Or for a more complex example:
from trywebscraping import Fetch
amazon = Fetch("https://www.amazon.com/s?k=cracking+the+coding+interview")
product_listings = amazon.query("div.s-card-container").extract({
"title": "h2 a span.a-text-normal",
"price": "span.a-price-whole",
"rating": "span.a-icon-alt",
"num_reviews": "a-size-base",
"product_link": "h2 a.a-link-normal@href",
"product_image": "img.s-image@src"
})
print(product_listings)
If you're interested in this project, please connect with me:
- Schedule a call: https://cal.com/lukelucas/30min
- Email: luke.lucas@trywebscraping.com
For issues, feedback, or general discussion about the library, you can use our GitHub repository: https://github.com/webscrape/trywebscraping-python
I appreciate any communications, regardless of how you choose to reach out!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trywebscraping-0.1.32.tar.gz
(11.1 kB
view details)
Built Distribution
File details
Details for the file trywebscraping-0.1.32.tar.gz
.
File metadata
- Download URL: trywebscraping-0.1.32.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f3d90b1405e7810c71635253c879d5691e939abba7f0bcb87d32ddc0caab46 |
|
MD5 | 5548d4917bef541abf4dc45bb822a696 |
|
BLAKE2b-256 | ee0bc2b2e7f6028123cd6c2a8a3c72f6e10ccba584bbdf3f1e84c485b5506aeb |
File details
Details for the file trywebscraping-0.1.32-py3-none-any.whl
.
File metadata
- Download URL: trywebscraping-0.1.32-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aff18cc87b277aa601440388274486acca827a1988c208392482ecb6b70e0b4 |
|
MD5 | a71ce8226320746bd9d5627b8c28f8a8 |
|
BLAKE2b-256 | cb52b8e4845b6b004fa03cc177fb61033e5a9c7de281ee1771c132672963197f |