Skip to content

Commit 265af59

Browse files
committed
fix: command
1 parent 165dae6 commit 265af59

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

amazon.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from trywebscraping import Fetch
2+
3+
amazon = Fetch("https://www.amazon.com/s?k=cracking+the+coding+interview")
4+
product_listings = amazon.query("div.s-card-container").extract({
5+
"title": "h2 a span.a-text-normal",
6+
"price": "span.a-price-whole",
7+
"rating": "span.a-icon-alt",
8+
"num_reviews": "a-size-base",
9+
"product_link": "h2 a.a-link-normal@href",
10+
"product_image": "img.s-image@src"
11+
})
12+
13+
# Print the results
14+
print(product_listings)
15+
16+
# If you want to pretty print the results, you can use:
17+
# import json
18+
# print(json.dumps(top_offers, indent=2))

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
trywebscraping==0.1.19
1+
trywebscraping==0.1.31

0 commit comments

Comments
 (0)