adops_report_scrapper 0.1.10 → 0.1.11
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 +4 -4
- data/lib/adops_report_scrapper/tremor_client.rb +14 -6
- data/lib/adops_report_scrapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a7726d818edcbdd387a0e71920913c9bd7cbb4d
|
4
|
+
data.tar.gz: 10cbda15f234612d1aea6133f67d34198a4aba61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22740395648458a558e3ab7dd5c9e52891cf4b07edd24f5b0768c22a0331f6f1f4e3bc1e98792bfae26c832e6c78290ef11d97f4ac3f38d4f33d7a6698f3271f
|
7
|
+
data.tar.gz: de038e6791f36446156590e1f9b0f2c35368e177b21a48992395f85eabfd0055fa4af6b8b112311ab2b0378588a56c06a53575b94df100982f690b45ff23227e
|
@@ -23,15 +23,22 @@ class AdopsReportScrapper::TremorClient < AdopsReportScrapper::BaseClient
|
|
23
23
|
|
24
24
|
def request_report
|
25
25
|
@client.find(:xpath, '//*[text()="REPORTS"]').click
|
26
|
-
@client.find(:xpath, '//*[text()="
|
26
|
+
@client.find(:xpath, '//*[text()="Custom"]').click
|
27
|
+
sleep 1
|
28
|
+
@client.find(:xpath, '//*[text()="New"]').click
|
27
29
|
sleep 1
|
28
30
|
# select group by
|
29
|
-
@client.find(:css, '#
|
30
|
-
@client.find(:xpath, '//*[text()="
|
31
|
-
@client.find(:
|
32
|
-
@client.find(:xpath, '//*[text()="
|
31
|
+
@client.find(:css, '#availableFieldsListSearch').click
|
32
|
+
@client.find(:xpath, '//*[text()="Supply Domain"]').click
|
33
|
+
@client.find(:xpath, '//*[text()="Ad Unit"]').click
|
34
|
+
@client.find(:xpath, '//*[text()="Requests"]').click
|
35
|
+
@client.find(:xpath, '//*[text()="Fills"]').click
|
36
|
+
@client.find(:xpath, '//*[text()="Impressions"]').click
|
37
|
+
@client.find(:xpath, '//*[text()="Completions"]').click
|
38
|
+
@client.find(:xpath, '//*[text()="Total Net Revenue"]').click
|
39
|
+
@client.find(:css, '.custom-report-dropdown-glyph.glyphicon-remove').click
|
33
40
|
# select date
|
34
|
-
@client.find(:css, '#
|
41
|
+
@client.find(:css, '#customReportsDateRanges').click
|
35
42
|
@client.find(:xpath, '//*[text()="Yesterday"]').click
|
36
43
|
@client.click_button 'Run'
|
37
44
|
sleep 10
|
@@ -46,6 +53,7 @@ class AdopsReportScrapper::TremorClient < AdopsReportScrapper::BaseClient
|
|
46
53
|
end
|
47
54
|
|
48
55
|
def extract_data_from_report
|
56
|
+
byebug
|
49
57
|
rows = @client.find_all :xpath, '//table/*/tr'
|
50
58
|
@data = rows.map { |tr| tr.find_css('td,th').map { |td| td.visible_text } }
|
51
59
|
end
|