Преглед изворни кода

Scraping steam discounted prices using beautiful soup

David Leonard пре 10 година
родитељ
комит
99ce05df8b
1 измењених фајлова са 12 додато и 1 уклоњено
  1. 12 1
      hackathon_starter/hackathon/scripts/scraper.py

+ 12 - 1
hackathon_starter/hackathon/scripts/scraper.py

@@ -35,4 +35,15 @@ for discountedGame in discount:
 	for tag in span:
 		gameDiscounts.append(tag.text)
 
-print gameDiscounts
+print gameDiscounts
+
+price = soup.findAll('div', {'class': 'col search_price discounted'})
+
+prices = []
+# Get all discounted prices
+for value in price:
+	br = value.findAll('br')
+	for tag in br:
+		prices.append(tag.text.strip('\t'))
+
+print prices