adops_report_scrapper 0.1.7 → 0.1.8
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: f944b7ae70baaf3fe734a1cd35ba5f4c906c3312
|
4
|
+
data.tar.gz: 77e9d7a9d7f34c0302c22c5402335eec714a9def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d83c297a1a21a583995f23e83f4dd36b4ec71f93434cdf46e9d3c0f1f00f0faa04e17ccd30361aaaece8d3dd8e5cdf9e9e18a4e7e37e6ebf5dd889b3c518563
|
7
|
+
data.tar.gz: 2bfcc8254e1798633b6fa429056c22855c90855d01077d4b7d3e7bff16f28ba8f7bef74791e78f96ca5bb075b9752299146e1fdbe71bda00dc8e3d7b7d28f1cd
|
@@ -18,9 +18,13 @@ class AdopsReportScrapper::TripleliftClient < AdopsReportScrapper::BaseClient
|
|
18
18
|
|
19
19
|
def scrap
|
20
20
|
@date_str = @date.strftime('%B %d, %Y')
|
21
|
-
@client.find(:xpath, '//*[
|
22
|
-
|
23
|
-
@client.find(:xpath, '
|
21
|
+
@client.find(:xpath, '//*[text()="Reporting"]').click
|
22
|
+
wait_for_spin
|
23
|
+
@client.find(:xpath, '//button[../../div[contains(text(),"Publisher")]]').click
|
24
|
+
@publishers = @client.find_all(:xpath, '//*[@ng-click="selectPublisher(pub)"]').to_a.map { |pub_elem| pub_elem.text(:all) }
|
25
|
+
sleep 2
|
26
|
+
@publishers = @client.find_all(:xpath, '//*[@ng-click="selectPublisher(pub)"]').to_a.map { |pub_elem| pub_elem.text(:all) }
|
27
|
+
@client.find(:xpath, '//button[../../div[contains(text(),"Publisher")]]').click
|
24
28
|
@data = []
|
25
29
|
while @publishers.count > 0
|
26
30
|
extract_data(@publishers.shift)
|
@@ -28,13 +32,14 @@ class AdopsReportScrapper::TripleliftClient < AdopsReportScrapper::BaseClient
|
|
28
32
|
end
|
29
33
|
|
30
34
|
def extract_data(publisher)
|
31
|
-
@client.find(:xpath, '//*[@ng-if="publishers.length > 1"]').click
|
32
|
-
index = -1 - @publishers.count(publisher)
|
33
|
-
sleep 1
|
34
|
-
@client.find_all(:xpath, "//*[text()=\"#{publisher}\"]")[index].click
|
35
35
|
10.times do
|
36
36
|
@client.find(:xpath, '//*[text()="Reporting"]').click
|
37
37
|
sleep 2
|
38
|
+
@client.find(:xpath, '//button[../../div[contains(text(),"Publisher")]]').click
|
39
|
+
index = -1 - @publishers.count(publisher)
|
40
|
+
sleep 1
|
41
|
+
@client.find_all(:xpath, "//*[text()=\"#{publisher}\"]")[index].click
|
42
|
+
wait_for_spin
|
38
43
|
|
39
44
|
return if @client.find_all(:xpath, '//*[text()="No data available for selected date range"]').count > 0
|
40
45
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adops_report_scrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stayman Hou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|