adops_report_scrapper 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6923611409097a83da3eaea3bf39b2b3753659d0
|
4
|
+
data.tar.gz: fb6d4cf022cb3a570619ac7755b75e9c605716ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21dcfc4c96bdad16af2568a08a4367a740a512c572b29d69bc7c87042579cef3f96d459ce7550b19d48c65d13641eea9006aec7854d49361cc8eda72c1ce5903
|
7
|
+
data.tar.gz: dd660b46fa71be3de6e1955c42fe44de8726d9303c8d0124e05af34b63fe2959dacc96e3c0e1021e22579ef0946471dcf3910e2d06d53fbf4d47a4b3e2b01f83
|
@@ -23,10 +23,21 @@ class AdopsReportScrapper::BrightrollClient < AdopsReportScrapper::BaseClient
|
|
23
23
|
|
24
24
|
def request_report
|
25
25
|
@client.find(:xpath, '//*[text()="Tags"]').click
|
26
|
-
|
26
|
+
wait_for_loading
|
27
27
|
# select date
|
28
|
+
@client.find(:css, '.details-date-filter').click
|
28
29
|
@client.find(:xpath, '//*[text()="Yesterday"]').click
|
30
|
+
wait_for_loading
|
31
|
+
end
|
29
32
|
|
33
|
+
def extract_data_from_report
|
34
|
+
rows = @client.find_all :xpath, '//table[1]/*/tr'
|
35
|
+
rows = rows.to_a
|
36
|
+
rows.delete_at 1
|
37
|
+
@data = rows.map { |tr| tr.find_css('td,th').map { |td| td.visible_text } }
|
38
|
+
end
|
39
|
+
|
40
|
+
def wait_for_loading
|
30
41
|
30.times do |_i| # wait 5 min
|
31
42
|
begin
|
32
43
|
@client.find(:css, '.bubble-loader.bubble-loader-3')
|
@@ -37,11 +48,4 @@ class AdopsReportScrapper::BrightrollClient < AdopsReportScrapper::BaseClient
|
|
37
48
|
end
|
38
49
|
sleep 10
|
39
50
|
end
|
40
|
-
|
41
|
-
def extract_data_from_report
|
42
|
-
rows = @client.find_all :xpath, '//table[1]/*/tr'
|
43
|
-
rows = rows.to_a
|
44
|
-
rows.delete_at 1
|
45
|
-
@data = rows.map { |tr| tr.find_css('td,th').map { |td| td.visible_text } }
|
46
|
-
end
|
47
51
|
end
|