We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 165dae6 commit 265af59Copy full SHA for 265af59
amazon.py
@@ -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
@@ -1 +1 @@
-trywebscraping==0.1.19
+trywebscraping==0.1.31
0 commit comments