steam_scraper 1.1.3 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d35d39b0ec4e9ee65403d6f213f02818db2bc493
|
4
|
+
data.tar.gz: ff9f3ec8ec11b965da0a3d8cf3d958f99536af83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c464a5c2d986221968cb6cbc1ab6ecfcab3c6e11a93a732eda686ef09722d1585e5649c6e399a53ee4486939a5c83e5c65ddcf5c87037c9bc2cf1840e91a8cd
|
7
|
+
data.tar.gz: c98b76070ddefc042c4871b328f27b6a7e416b8aaada35b451eedc16c1cfb0e4f1d475d14523b7bfa3ded45c9563c4b29e608ccd5210f9f93da2616032d6ffeb
|
@@ -32,9 +32,7 @@ class GameListScraper
|
|
32
32
|
puts 'Scraping Page ' + page.to_s
|
33
33
|
items_on_page = search_results(page)
|
34
34
|
scrape_page(items_on_page)
|
35
|
-
puts 'Page Complete'
|
36
35
|
end
|
37
|
-
puts 'Scraping Complete'
|
38
36
|
@game_list
|
39
37
|
end
|
40
38
|
|
@@ -62,7 +60,15 @@ class GameListScraper
|
|
62
60
|
end
|
63
61
|
|
64
62
|
def scrape_release_date(entry)
|
65
|
-
|
63
|
+
date_node_text = entry.xpath(".//div[contains(@class, 'search_released')]").text
|
64
|
+
date = nil
|
65
|
+
begin
|
66
|
+
date = Date.parse(date_node_text)
|
67
|
+
rescue ArgumentError
|
68
|
+
puts 'Invalid date found. Probably in the future. Date set to nil'
|
69
|
+
end
|
70
|
+
|
71
|
+
date
|
66
72
|
end
|
67
73
|
|
68
74
|
def scrape_platforms(entry)
|
@@ -81,7 +87,8 @@ class GameListScraper
|
|
81
87
|
|
82
88
|
def get_review_contents(entry)
|
83
89
|
node = entry.xpath(".//span[contains(@class, 'search_review_summary')]")
|
84
|
-
result =
|
90
|
+
result = nil
|
91
|
+
result = node.attribute('data-store-tooltip').value unless node.empty?
|
85
92
|
|
86
93
|
result
|
87
94
|
end
|
@@ -15,7 +15,7 @@ class GamePageScraper
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def scrape_game!(game, url)
|
18
|
-
puts 'Scraping
|
18
|
+
puts 'Scraping additional data for ' + game[:name]
|
19
19
|
page_contents = get_page_contents(url)
|
20
20
|
game[:metacritic] = scrape_metacritic(page_contents)
|
21
21
|
game[:tags] = scrape_tags(page_contents)
|
@@ -84,6 +84,7 @@ class GamePageScraper
|
|
84
84
|
spec_hash = {}
|
85
85
|
spec_array.each do |entry|
|
86
86
|
value_pair = entry.split(':')
|
87
|
+
next if value_pair.first.nil?
|
87
88
|
key = value_pair.first.to_sym
|
88
89
|
value = value_pair.last.strip
|
89
90
|
spec_hash[key] = value
|