aranha 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aranha/fixtures/download.rb +1 -1
- data/lib/aranha/version.rb +1 -1
- metadata +22 -29
- data/lib/aranha/selenium.rb +0 -7
- data/lib/aranha/selenium/driver_factory.rb +0 -47
- data/lib/aranha/selenium/driver_factory/base.rb +0 -68
- data/lib/aranha/selenium/driver_factory/chrome.rb +0 -29
- data/lib/aranha/selenium/driver_factory/firefox.rb +0 -55
- data/lib/aranha/selenium/driver_factory/firefox_auto_download_mime_types +0 -685
- data/lib/aranha/selenium/session.rb +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc0b0f68dfd7576517ef66690315b1b8ee7f4588d7e301da9e21c6c49f571a4
|
4
|
+
data.tar.gz: bb938f62aef635868823bea91b6a38f0e75c2dd64a7c4d8714bae088eb2464c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7c6e6e018d15345dfb08b05da2c6b4ad090dd64c61689ddf7affb26aeda24d460ac8f3fe97cf80215777efca067ee544f2307c0852208ef1c13a0ffe379d080
|
7
|
+
data.tar.gz: 3fe52dfd08a08301e8a26b42eeb5a57f619d589973422b2e7d36b48a19747d8cc1ea563b2e11a6d46c05de14d3ad46e2e3220b7a207fa9f170bc01db80558c71
|
data/lib/aranha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aranha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
@@ -26,6 +26,26 @@ dependencies:
|
|
26
26
|
version: 3.4.41.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aranha-parsers
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.1.1
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.1'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.1.1
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: aranha-selenium
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
51
|
- - "~>"
|
@@ -86,26 +106,6 @@ dependencies:
|
|
86
106
|
- - "~>"
|
87
107
|
- !ruby/object:Gem::Version
|
88
108
|
version: 4.2.10
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: selenium-webdriver
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '3.142'
|
96
|
-
- - ">="
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: 3.142.3
|
99
|
-
type: :runtime
|
100
|
-
prerelease: false
|
101
|
-
version_requirements: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - "~>"
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '3.142'
|
106
|
-
- - ">="
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: 3.142.3
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: rspec
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,13 +164,6 @@ files:
|
|
164
164
|
- lib/aranha/fixtures.rb
|
165
165
|
- lib/aranha/fixtures/download.rb
|
166
166
|
- lib/aranha/processor.rb
|
167
|
-
- lib/aranha/selenium.rb
|
168
|
-
- lib/aranha/selenium/driver_factory.rb
|
169
|
-
- lib/aranha/selenium/driver_factory/base.rb
|
170
|
-
- lib/aranha/selenium/driver_factory/chrome.rb
|
171
|
-
- lib/aranha/selenium/driver_factory/firefox.rb
|
172
|
-
- lib/aranha/selenium/driver_factory/firefox_auto_download_mime_types
|
173
|
-
- lib/aranha/selenium/session.rb
|
174
167
|
- lib/aranha/version.rb
|
175
168
|
- lib/tasks/aranha_tasks.rake
|
176
169
|
- test/aranha_test.rb
|
data/lib/aranha/selenium.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/hash/indifferent_access'
|
4
|
-
require 'aranha/selenium/driver_factory/base'
|
5
|
-
require 'aranha/selenium/driver_factory/chrome'
|
6
|
-
require 'aranha/selenium/driver_factory/firefox'
|
7
|
-
|
8
|
-
module Aranha
|
9
|
-
module Selenium
|
10
|
-
class DriverFactory
|
11
|
-
class << self
|
12
|
-
def create_driver(options = {})
|
13
|
-
new(options).create_driver
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
attr_reader :options
|
18
|
-
|
19
|
-
def initialize(options)
|
20
|
-
@options = options.with_indifferent_access.freeze
|
21
|
-
end
|
22
|
-
|
23
|
-
def create_driver
|
24
|
-
driver_class.new(driver_options).build
|
25
|
-
end
|
26
|
-
|
27
|
-
def driver_name
|
28
|
-
(options[:driver] || default_driver_name).to_s
|
29
|
-
end
|
30
|
-
|
31
|
-
def driver_class
|
32
|
-
Aranha::Selenium::DriverFactory.const_get(driver_name.classify)
|
33
|
-
rescue NameError
|
34
|
-
raise "Unknown Aranha Selenium driver: \"#{driver_name}\"" \
|
35
|
-
" (Class \"Aranha::Selenium::DriverFactory::#{driver_name.classify}\" not found)"
|
36
|
-
end
|
37
|
-
|
38
|
-
def default_driver_name
|
39
|
-
:firefox
|
40
|
-
end
|
41
|
-
|
42
|
-
def driver_options
|
43
|
-
options.except(:driver)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/hash/indifferent_access'
|
4
|
-
require 'tmpdir'
|
5
|
-
|
6
|
-
module Aranha
|
7
|
-
module Selenium
|
8
|
-
class DriverFactory
|
9
|
-
class Base
|
10
|
-
DEFAULT_DOWNLOADS_DIR = ::File.join(::Dir.tmpdir, 'aranha_downloads_dir')
|
11
|
-
DEFAULT_ACCEPT_INSECURE_CERTS = false
|
12
|
-
DEFAULT_HEADLESS = false
|
13
|
-
|
14
|
-
class << self
|
15
|
-
attr_writer:default_accept_insecure_certs, :default_downloads_dir, :default_headless
|
16
|
-
|
17
|
-
def default_downloads_dir
|
18
|
-
@default_downloads_dir || DEFAULT_DOWNLOADS_DIR
|
19
|
-
end
|
20
|
-
|
21
|
-
def default_accept_insecure_certs
|
22
|
-
@default_accept_insecure_certs || DEFAULT_ACCEPT_INSECURE_CERTS
|
23
|
-
end
|
24
|
-
|
25
|
-
def default_headless
|
26
|
-
@default_headless || DEFAULT_HEADLESS
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
attr_reader :options
|
31
|
-
|
32
|
-
def initialize(options)
|
33
|
-
@options = options.with_indifferent_access.freeze
|
34
|
-
end
|
35
|
-
|
36
|
-
def build
|
37
|
-
raise 'Must be overrided'
|
38
|
-
end
|
39
|
-
|
40
|
-
def downloads_dir
|
41
|
-
option_value(:downloads_dir)
|
42
|
-
end
|
43
|
-
|
44
|
-
def accept_insecure_certs?
|
45
|
-
option_value(:accept_insecure_certs)
|
46
|
-
end
|
47
|
-
|
48
|
-
def headless?
|
49
|
-
option_value(:headless)
|
50
|
-
end
|
51
|
-
|
52
|
-
def user_agent
|
53
|
-
options.fetch(:user_agent)
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def option_value(key)
|
59
|
-
if options.key?(key)
|
60
|
-
options.fetch(key)
|
61
|
-
else
|
62
|
-
::Aranha::Selenium::DriverFactory::Base.send("default_#{key}")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'selenium-webdriver'
|
4
|
-
require 'aranha/selenium/driver_factory/base'
|
5
|
-
|
6
|
-
module Aranha
|
7
|
-
module Selenium
|
8
|
-
class DriverFactory
|
9
|
-
class Chrome < ::Aranha::Selenium::DriverFactory::Base
|
10
|
-
def build
|
11
|
-
::Selenium::WebDriver.for :chrome, options: chrome_options
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def chrome_options
|
17
|
-
r = ::Selenium::WebDriver::Chrome::Options.new
|
18
|
-
r.add_argument('--ignore-certificate-errors') if accept_insecure_certs?
|
19
|
-
r.add_argument('--headless') if headless?
|
20
|
-
r.add_argument('--disable-popup-blocking')
|
21
|
-
r.add_argument('--disable-translate')
|
22
|
-
r.add_argument("user-agent=#{user_agent}") if user_agent.present?
|
23
|
-
r.add_preference(:download, prompt_for_download: false, default_directory: downloads_dir)
|
24
|
-
r
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'selenium-webdriver'
|
4
|
-
require 'aranha/selenium/driver_factory/base'
|
5
|
-
|
6
|
-
module Aranha
|
7
|
-
module Selenium
|
8
|
-
class DriverFactory
|
9
|
-
class Firefox < ::Aranha::Selenium::DriverFactory::Base
|
10
|
-
def build
|
11
|
-
::Selenium::WebDriver.for(
|
12
|
-
:firefox,
|
13
|
-
options: ::Selenium::WebDriver::Firefox::Options.new(
|
14
|
-
profile: build_profile,
|
15
|
-
args: build_args
|
16
|
-
),
|
17
|
-
desired_capabilities: build_capabilities
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def build_args
|
24
|
-
r = []
|
25
|
-
r << '-headless' if headless?
|
26
|
-
r
|
27
|
-
end
|
28
|
-
|
29
|
-
def build_capabilities
|
30
|
-
if accept_insecure_certs?
|
31
|
-
::Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
|
32
|
-
else
|
33
|
-
::Selenium::WebDriver::Remote::Capabilities.firefox
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def build_profile
|
38
|
-
r = ::Selenium::WebDriver::Firefox::Profile.new
|
39
|
-
r['browser.download.dir'] = downloads_dir
|
40
|
-
r['browser.download.folderList'] = 2
|
41
|
-
r['browser.helperApps.neverAsk.saveToDisk'] = auto_download_mime_types.join(';')
|
42
|
-
r['pdfjs.disabled'] = true
|
43
|
-
r['general.useragent.override'] = user_agent if user_agent.present?
|
44
|
-
r
|
45
|
-
end
|
46
|
-
|
47
|
-
def auto_download_mime_types
|
48
|
-
::File.read(
|
49
|
-
::File.join(__dir__, 'firefox_auto_download_mime_types')
|
50
|
-
).each_line.map(&:strip)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,685 +0,0 @@
|
|
1
|
-
application/andrew-inset
|
2
|
-
application/applixware
|
3
|
-
application/atomcat+xml
|
4
|
-
application/atomsvc+xml
|
5
|
-
application/atom+xml
|
6
|
-
application/ccxml+xml,
|
7
|
-
application/cdmi-capability
|
8
|
-
application/cdmi-container
|
9
|
-
application/cdmi-domain
|
10
|
-
application/cdmi-object
|
11
|
-
application/cdmi-queue
|
12
|
-
application/cu-seeme
|
13
|
-
application/davmount+xml
|
14
|
-
application/dssc+der
|
15
|
-
application/dssc+xml
|
16
|
-
application/ecmascript
|
17
|
-
application/emma+xml
|
18
|
-
application/epub+zip
|
19
|
-
application/exi
|
20
|
-
application/font-tdpfr
|
21
|
-
application/hyperstudio
|
22
|
-
application/ipfix
|
23
|
-
application/java-archive
|
24
|
-
application/javascript
|
25
|
-
application/java-serializd-object
|
26
|
-
application/java-vm
|
27
|
-
application/json
|
28
|
-
application/mac-binhex40
|
29
|
-
application/mac-compactpro
|
30
|
-
application/mads+xml
|
31
|
-
application/marc
|
32
|
-
application/marcxml+xml
|
33
|
-
application/mathematica
|
34
|
-
application/mathml+xml
|
35
|
-
application/mbox
|
36
|
-
application/mediaservercontrol+xml
|
37
|
-
application/metalink4+xml
|
38
|
-
application/mets+xml
|
39
|
-
application/mods+xml
|
40
|
-
application/mp21
|
41
|
-
application/mp4
|
42
|
-
application/msword
|
43
|
-
application/mxf
|
44
|
-
application/nd.uiq.theme
|
45
|
-
application/octet-stream
|
46
|
-
application/oda
|
47
|
-
application/oebps-package+xml
|
48
|
-
application/ogg
|
49
|
-
application/onenote
|
50
|
-
application/patch-ops-error+xml
|
51
|
-
application/pdf
|
52
|
-
application/pgp-encrypted
|
53
|
-
application/pgp-signature
|
54
|
-
application/pics-rules
|
55
|
-
application/pkcs10
|
56
|
-
application/pkcs7-mime
|
57
|
-
application/pkcs7-signature
|
58
|
-
application/pkcs8
|
59
|
-
application/pkix-attr-cert
|
60
|
-
application/pkix-cert
|
61
|
-
application/pkixcmp
|
62
|
-
application/pkix-crl
|
63
|
-
application/pkix-pkipath
|
64
|
-
application/pls+xml
|
65
|
-
application/postscript
|
66
|
-
application/prs.cww
|
67
|
-
application/pskc+xml
|
68
|
-
application/rdf+xml
|
69
|
-
application/reginfo+xml
|
70
|
-
application/relax-ng-compact-syntax
|
71
|
-
application/resource-lists-diff+xml
|
72
|
-
application/resource-lists+xml
|
73
|
-
application/rls-services+xml
|
74
|
-
application/rsd+xml
|
75
|
-
application/rss+xml
|
76
|
-
application/rtf
|
77
|
-
application/sbml+xml
|
78
|
-
application/scvp-cv-request
|
79
|
-
application/scvp-vp-request
|
80
|
-
application/scvp-vp-response
|
81
|
-
application/sdp
|
82
|
-
application/set-payment-initiation
|
83
|
-
application/set-reistration-initiation
|
84
|
-
application/shf+xml
|
85
|
-
application/smil+xml
|
86
|
-
application/sml+xml
|
87
|
-
application/sparql-query
|
88
|
-
application/sparql-results+xml
|
89
|
-
application/srgs
|
90
|
-
application/srgs+xml
|
91
|
-
application/sru+xml
|
92
|
-
application/svp-cv-response
|
93
|
-
application/tei+xml
|
94
|
-
application/thraud+xml
|
95
|
-
application/timestamped-data
|
96
|
-
application/vn.contact.cmsg
|
97
|
-
application/vn.crick.clicker.wordbank
|
98
|
-
application/vnd.3gp2.tcap
|
99
|
-
application/vnd.3gpp.pic-bw-large
|
100
|
-
application/vnd.3gpp.pic-bw-small
|
101
|
-
application/vnd.3gpp.pic-bw-var
|
102
|
-
application/vnd.3m.post-it-notes
|
103
|
-
application/vnd.accpac.simply.aso
|
104
|
-
application/vnd.accpac.simply.imp
|
105
|
-
application/vnd.acucobol
|
106
|
-
application/vnd.acucorp
|
107
|
-
application/vnd.adobe.air-application-installer-package+zip
|
108
|
-
application/vnd.adobe.fxp
|
109
|
-
application/vnd.adobe.xdp+xml
|
110
|
-
application/vnd.adobe.xfdf
|
111
|
-
application/vnd.ahead.space
|
112
|
-
application/vnd.airzip.filesecure.azf
|
113
|
-
application/vnd.airzip.filesecure.azs
|
114
|
-
application/vnd.amazon.ebook
|
115
|
-
application/vnd.americandynamics.acc
|
116
|
-
application/vnd.amiga.ami
|
117
|
-
application/vnd.android.package-archive
|
118
|
-
application/vnd.anser-web-certificate-issue-initiation
|
119
|
-
application/vnd.anser-web-funds-transfer-initiation
|
120
|
-
application/vnd.antix.game-component
|
121
|
-
application/vnd.apple.installe+xml
|
122
|
-
application/vnd.apple.mpegurl
|
123
|
-
application/vnd.aristanetworks.swi
|
124
|
-
application/vnd.asis.opendocument.text-template
|
125
|
-
application/vnd.audiograph
|
126
|
-
application/vnd.blueice.multipass
|
127
|
-
application/vnd.bm
|
128
|
-
application/vnd.businessobjects
|
129
|
-
application/vnd.chemdraw+xml
|
130
|
-
application/vnd.chipnuts.karaoke-mmd
|
131
|
-
application/vnd.cinderella
|
132
|
-
application/vnd.claymore
|
133
|
-
application/vnd.cloanto.rp9
|
134
|
-
application/vnd.clonk.c4group
|
135
|
-
applicationvnd.cluetrust.cartomobile-config
|
136
|
-
application/vnd.cluetrust.cartomobile-config-pkg
|
137
|
-
application/vnd.commonspace
|
138
|
-
application/vnd.cosmocaller
|
139
|
-
application/vnd.crick.clicker
|
140
|
-
application/vnd.crick.clicker.keyboard
|
141
|
-
application/vnd.crick.clicker.palette
|
142
|
-
application/vnd.crick.clicker.template
|
143
|
-
application/vnd.criticaltools.wbs+xml
|
144
|
-
application/vnd.ctc-posml
|
145
|
-
application/vnd.cups-ppd
|
146
|
-
application/vnd.curl.car
|
147
|
-
application/vnd.curl.pcurl
|
148
|
-
application/vnd.data-vision.rdz
|
149
|
-
application/vnd.dolby.mlp
|
150
|
-
application/vnd.dpgraph
|
151
|
-
application/vnd.dreamfactory
|
152
|
-
application/vnd.dvb.ait
|
153
|
-
application/vnd.dvb.service
|
154
|
-
application/vnd.dynageo
|
155
|
-
application/vnd.ecowin.chart
|
156
|
-
application/vnd.enliven
|
157
|
-
application/vn.denovo.fcselayout-link
|
158
|
-
application/vnd.epson.esf
|
159
|
-
application/vnd.epson.msf
|
160
|
-
application/vnd.epson.quickanime
|
161
|
-
application/vnd.epson.salt
|
162
|
-
application/vnd.epson.ssf
|
163
|
-
application/vnd.eszigno3+xml
|
164
|
-
application/vnd.ezpix-album
|
165
|
-
application/vnd.ezpix-package
|
166
|
-
application/vnd.fdf
|
167
|
-
application/vnd.fdsn.seed
|
168
|
-
application/vnd.flographit
|
169
|
-
application/vnd.fluxtime.clip
|
170
|
-
application/vnd.framemaker
|
171
|
-
application/vnd.frogans.fnc
|
172
|
-
application/vnd.frogans.ltf
|
173
|
-
application/vnd.fsc.weblaunch
|
174
|
-
application/vnd.fujitsu.oasys2
|
175
|
-
application/vnd.fujitsu.oasys3
|
176
|
-
application/vnd.fujitsu.oasysgp
|
177
|
-
application/vnd.fujitsu.oasysprs
|
178
|
-
application/vnd.fujitu.oasys
|
179
|
-
application/vnd.fujixerox.ddd
|
180
|
-
application/vnd.fujixerox.docuworks
|
181
|
-
application/vnd.fujixerox.docuworks.binder
|
182
|
-
application/vnd.fuzzysheet
|
183
|
-
application/vnd.genomatix.tuxedo
|
184
|
-
application/vnd.geogebra.file
|
185
|
-
application/vnd.geogebra.tool
|
186
|
-
application/vnd.geometry-explorer
|
187
|
-
application/vnd.geonext
|
188
|
-
application/vnd.geoplan
|
189
|
-
application/vnd.geospace
|
190
|
-
application/vnd.gmx
|
191
|
-
application/vnd.google-earth.kml+xml
|
192
|
-
application/vnd.google-earth.kmz
|
193
|
-
application/vnd.grafeq
|
194
|
-
application/vnd.groove-account
|
195
|
-
application/vnd.groove-help
|
196
|
-
application/vnd.groove-identity-message
|
197
|
-
application/vnd.groove-injector
|
198
|
-
application/vnd.groove-tool-message
|
199
|
-
application/vnd.groove-tool-template
|
200
|
-
application/vnd.groove-vcar
|
201
|
-
application/vnd.hal+xml
|
202
|
-
application/vnd.handheld-entertainment+xml
|
203
|
-
application/vnd.hbci
|
204
|
-
application/vnd.hhe.lesson-player
|
205
|
-
application/vnd.hp-hpgl
|
206
|
-
application/vnd.hp-hpid
|
207
|
-
application/vnd.hp-hps
|
208
|
-
application/vnd.hp-jlyt
|
209
|
-
application/vnd.hp-pcl
|
210
|
-
application/vnd.hp-pclxl
|
211
|
-
application/vnd.hydrostatix.sof-data
|
212
|
-
application/vnd.hzn-3d-crossword
|
213
|
-
application/vnd.ibm.minipay
|
214
|
-
application/vnd.ibm.modcap
|
215
|
-
application/vnd.ibm.rights-management
|
216
|
-
application/vnd.ibm.securecontainer
|
217
|
-
application/vnd.iccprofile
|
218
|
-
application/vnd.igloader
|
219
|
-
application/vnd.immervision-ivp
|
220
|
-
application/vnd.immervision-ivu
|
221
|
-
application/vnd.insors.igm
|
222
|
-
application/vnd.intercon.formnet
|
223
|
-
application/vnd.intergeo
|
224
|
-
application/vnd.intu.qbo
|
225
|
-
application/vnd.intu.qfx
|
226
|
-
application/vnd.ipunplugged.rcprofile
|
227
|
-
application/vnd.irepository.package+xml
|
228
|
-
application/vnd.isac.fcs
|
229
|
-
application/vnd.is-xpr
|
230
|
-
application/vnd.jam
|
231
|
-
application/vnd.jcp.javame.midlet-rms
|
232
|
-
application/vnd.jisp
|
233
|
-
application/vnd.joost.joda-archive
|
234
|
-
application/vnd.kahootz
|
235
|
-
application/vnd.kde.karbon
|
236
|
-
application/vnd.kde.kchart
|
237
|
-
application/vnd.kde.kformula
|
238
|
-
application/vnd.kde.kivio
|
239
|
-
application/vnd.kde.kontour
|
240
|
-
application/vnd.kde.kpresenter
|
241
|
-
application/vnd.kde.kspread
|
242
|
-
application/vnd.kde.kword
|
243
|
-
application/vnd.kenameaapp
|
244
|
-
application/vnd.kidspiration
|
245
|
-
application/vnd.kinar
|
246
|
-
application/vnd.koan
|
247
|
-
application/vnd.kodak-descriptor
|
248
|
-
application/vnd.las.las+xml
|
249
|
-
application/vnd.llamagraphics.life-balance.desktop
|
250
|
-
application/vnd.llamagraphics.life-balance.exchange+xml
|
251
|
-
application/vnd.lotus-1-2-3
|
252
|
-
application/vnd.lotus-approach
|
253
|
-
application/vnd.lotus-freelance
|
254
|
-
application/vnd.lotus-notes
|
255
|
-
application/vnd.lotus-organizer
|
256
|
-
application/vnd.lotus-screencam
|
257
|
-
application/vnd.lotus-wordro
|
258
|
-
application/vnd.macports.portpkg
|
259
|
-
application/vnd.mcd
|
260
|
-
application/vnd.medcalcdata
|
261
|
-
application/vnd.mediastation.cdkey
|
262
|
-
application/vnd.mfer
|
263
|
-
application/vnd.mfmp
|
264
|
-
application/vnd.micrografx.flo
|
265
|
-
application/vnd.micrografx.igx
|
266
|
-
application/vnd.mif
|
267
|
-
application/vnd.mobius.daf
|
268
|
-
application/vnd.mobius.dis
|
269
|
-
application/vnd.mobius.mbk
|
270
|
-
application/vnd.mobius.mqy
|
271
|
-
application/vnd.mobius.msl
|
272
|
-
application/vnd.mobius.plc
|
273
|
-
application/vnd.mobius.txf
|
274
|
-
application/vnd.mophun.application
|
275
|
-
application/vnd.mophun.certificate
|
276
|
-
application/vnd.mozilla.xul+xml
|
277
|
-
application/vnd.ms-artgalry
|
278
|
-
application/vnd.ms-ca-compressed
|
279
|
-
application/vnd.mseq
|
280
|
-
application/vnd.ms-excel
|
281
|
-
application/vnd.ms-excel.addin.macroenabled.12
|
282
|
-
application/vnd.ms-excelsheet.binary.macroenabled.12
|
283
|
-
application/vnd.ms-excel.sheet.macroenabled.12
|
284
|
-
application/vnd.ms-excel.template.macroenabled.12
|
285
|
-
application/vnd.ms-fontobject
|
286
|
-
application/vnd.ms-htmlhelp
|
287
|
-
application/vnd.msician
|
288
|
-
application/vnd.ms-ims
|
289
|
-
application/vnd.ms-lrm
|
290
|
-
application/vnd.ms-officetheme
|
291
|
-
application/vnd.ms-pki.seccat
|
292
|
-
application/vnd.ms-pki.stl
|
293
|
-
application/vnd.ms-powerpoint
|
294
|
-
application/vnd.ms-powerpoint.addin.macroenabled.12
|
295
|
-
application/vnd.ms-powerpoint.presentation.macroenabled.12
|
296
|
-
application/vnd.ms-powerpoint.slide.macroenabled.12
|
297
|
-
application/vnd.ms-powerpoint.slideshow.macroenabled.12
|
298
|
-
application/vnd.ms-powerpoint.template.macroenabled.12
|
299
|
-
application/vnd.ms-project
|
300
|
-
application/vnd.ms-word.document.macroenabled.12
|
301
|
-
application/vnd.ms-word.template.macroenabed.12
|
302
|
-
application/vnd.ms-works
|
303
|
-
application/vnd.ms-wpl
|
304
|
-
application/vnd.ms-xpsdocument
|
305
|
-
application/vnd.muvee.style
|
306
|
-
application/vnd.na
|
307
|
-
application/vnd.neurolanguage.nlu
|
308
|
-
application/vnd.noblenet-directory
|
309
|
-
application/vnd.noblenet-sealer
|
310
|
-
application/vnd.noblenet-web
|
311
|
-
application/vnd.nokia.n-gage.data
|
312
|
-
application/vnd.nokia.n-gage.symbian.install
|
313
|
-
application/vnd.nokia.radio-preset
|
314
|
-
application/vnd.nokia.radio-presets
|
315
|
-
application/vnd.novadigm.edm
|
316
|
-
application/vnd.novadigm.ext
|
317
|
-
application/vnd.novadim.edx
|
318
|
-
application/vnd.oasis.opendocumen.presentation-template
|
319
|
-
application/vnd.oasis.opendocument.char
|
320
|
-
application/vnd.oasis.opendocument.chart-template
|
321
|
-
application/vnd.oasis.opendocument.database
|
322
|
-
application/vnd.oasis.opendocument.formula
|
323
|
-
application/vnd.oasis.opendocument.formula-template
|
324
|
-
application/vnd.oasis.opendocument.graphics-template
|
325
|
-
application/vnd.oasis.opendocument.grapics
|
326
|
-
application/vnd.oasis.opendocument.image
|
327
|
-
application/vnd.oasis.opendocument.image-template
|
328
|
-
application/vnd.oasis.opendocument.presentation
|
329
|
-
application/vnd.oasis.opendocument.spreadsheet
|
330
|
-
application/vnd.oasis.opendocument.spreadsheet-template
|
331
|
-
application/vnd.oasis.opendocument.text
|
332
|
-
application/vnd.oasis.opendocument.text-master
|
333
|
-
application/vnd.oasis.opendocument.text-web
|
334
|
-
application/vnd.olpc-sugar
|
335
|
-
application/vnd.oma.dd2+xml
|
336
|
-
application/vnd.openofficeorg.extension
|
337
|
-
application/vnd.openxmformats-officedocument.wordprocessingml.document
|
338
|
-
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
339
|
-
application/vnd.openxmlformats-officedocument.presentationml.slide
|
340
|
-
application/vnd.openxmlformats-officedocument.presentationml.slideshw
|
341
|
-
application/vnd.openxmlformats-officedocument.presentationml.template
|
342
|
-
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
343
|
-
application/vnd.openxmlformats-officedocument.spreadsheetml.template
|
344
|
-
application/vnd.openxmlformats-officedocument.wordprocessingml.template
|
345
|
-
application/vnd.osgeo.mapguide.package
|
346
|
-
application/vnd.osgi.dp
|
347
|
-
application/vnd.palm
|
348
|
-
application/vnd.pawaafile
|
349
|
-
application/vnd.pg.format
|
350
|
-
application/vnd.pg.osasli
|
351
|
-
application/vnd.picsel
|
352
|
-
application/vnd.pmi.widget
|
353
|
-
application/vnd.pocketlearn
|
354
|
-
application/vnd.powerbuilder6
|
355
|
-
application/vnd.previewsystems.box
|
356
|
-
application/vnd.proteus.magazine
|
357
|
-
application/vnd.publishare-delta-tree
|
358
|
-
application/vnd.pvi.ptid1
|
359
|
-
application/vnd.quark.quarkxpress
|
360
|
-
application/vnd.realvnc.bed
|
361
|
-
application/vnd.recordare.musicxml
|
362
|
-
application/vnd.recordare.musicxml+xml
|
363
|
-
application/vnd.rig.cryptonote
|
364
|
-
application/vnd.rim.cod
|
365
|
-
application/vnd.rn-realmedia
|
366
|
-
application/vnd.route66.link66+xml
|
367
|
-
application/vnd.sailingtracker.track
|
368
|
-
application/vnd.seemail
|
369
|
-
application/vnd.sema
|
370
|
-
application/vnd.semd
|
371
|
-
application/vnd.semf
|
372
|
-
application/vnd.shana.informed.formdata
|
373
|
-
application/vnd.shana.informed.formtemplate
|
374
|
-
application/vnd.shana.informed.interchange
|
375
|
-
application/vnd.shana.informed.package
|
376
|
-
application/vnd.simtech-mindmapper
|
377
|
-
application/vnd.smaf
|
378
|
-
application/vnd.smart.teacher
|
379
|
-
application/vnd.solent.sdkm+xml
|
380
|
-
application/vnd.spotfire.dxp
|
381
|
-
application/vnd.spotfire.sfs
|
382
|
-
application/vnd.stardivision.calc
|
383
|
-
application/vnd.stardivision.draw
|
384
|
-
application/vnd.stardivision.impress
|
385
|
-
application/vnd.stardivision.math
|
386
|
-
application/vnd.stardivision.writer
|
387
|
-
application/vnd.stepmania.stepchart
|
388
|
-
application/vnd.sun.xl.impress.template
|
389
|
-
application/vnd.sun.xml.calc
|
390
|
-
application/vnd.sun.xml.calc.template
|
391
|
-
application/vnd.sun.xml.draw
|
392
|
-
application/vnd.sun.xml.draw.template
|
393
|
-
application/vnd.sun.xml.impress
|
394
|
-
application/vnd.sun.xml.math
|
395
|
-
application/vnd.sun.xml.writer
|
396
|
-
application/vnd.sun.xml.writer.global
|
397
|
-
application/vnd.sun.xml.writer.template
|
398
|
-
application/vnd.sus-calendar
|
399
|
-
application/vnd.svd
|
400
|
-
application/vnd.symbian.install
|
401
|
-
application/vnd.syncml.dm+wbxml
|
402
|
-
application/vnd.syncml.dm+xml
|
403
|
-
application/vnd.syncml+xml
|
404
|
-
application/vnd.tardivision.writer-global
|
405
|
-
application/vnd.tmobile-ivetv
|
406
|
-
application/vnd.to.intent-module-archive
|
407
|
-
applicationvnd.trid.tpt
|
408
|
-
application/vnd.triscape.mxs
|
409
|
-
application/vnd.trueapp
|
410
|
-
application/vnd.ufdl
|
411
|
-
application/vnd.ul
|
412
|
-
application/vnd.umajin
|
413
|
-
application/vnd.unity
|
414
|
-
application/vnd.uoml+xml
|
415
|
-
application/vnd.vcx
|
416
|
-
application/vnd.visionary
|
417
|
-
application/vnd.vsf
|
418
|
-
application/vnd.wap.wbxml
|
419
|
-
application/vnd.wap.wmlc
|
420
|
-
application/vnd.wap.wmlscriptc
|
421
|
-
application/vnd.webturb
|
422
|
-
application/vnd.wolfrm.player
|
423
|
-
application/vnd.wordperfect
|
424
|
-
application/vnd.wqd
|
425
|
-
application/vnd.wt.stf
|
426
|
-
application/vnd.xara
|
427
|
-
application/vnd.xfdl
|
428
|
-
application/vnd.yamaha.h-script
|
429
|
-
application/vnd.yamaha.hv-dic
|
430
|
-
application/vnd.yamaha.hv-voice
|
431
|
-
application/vnd.yamaha.openscoreformat
|
432
|
-
application/vnd.yamaha.openscoreformat.osfpvg+xml
|
433
|
-
application/vnd.yamaha.smaf-phrase
|
434
|
-
application/vnd.yellowriver-custom-menu
|
435
|
-
application/vnd.ymaha.smaf-audio
|
436
|
-
application/vnd.zzazz.deck+xml
|
437
|
-
application/vn.visio
|
438
|
-
application/voicexml+xml
|
439
|
-
application/widget
|
440
|
-
application/winhlp
|
441
|
-
application/wsdl+xml
|
442
|
-
application/wspolicy+xml
|
443
|
-
application/x-7z-compressed
|
444
|
-
application/x-abiword
|
445
|
-
application/x-ace-compressed
|
446
|
-
application/x-athorware-map
|
447
|
-
application/x-authorware-bin
|
448
|
-
application/x-authorware-seg
|
449
|
-
application/x-bcpio
|
450
|
-
application/x-bittorrent
|
451
|
-
application/x-bzip
|
452
|
-
application/x-bzip2
|
453
|
-
application/xcap-diff+xml
|
454
|
-
application/x-cdlink
|
455
|
-
application/x-chat
|
456
|
-
application/x-chess-pgn
|
457
|
-
application/x-cpio
|
458
|
-
application/x-csh
|
459
|
-
application/x-debian-package
|
460
|
-
application/x-director
|
461
|
-
application/x-doom
|
462
|
-
application/x-dtbncx+xml
|
463
|
-
application/x-dtbook+xml
|
464
|
-
application/x-dtbresource+xml
|
465
|
-
application/x-dvi
|
466
|
-
application/xenc+xml
|
467
|
-
application/x-font-bdf
|
468
|
-
application/x-font-ghostscript
|
469
|
-
application/x-font-linux-psf
|
470
|
-
application/x-font-otf
|
471
|
-
application/x-font-pcf
|
472
|
-
application/x-font-snf
|
473
|
-
application/x-font-ttf
|
474
|
-
application/xfont-type1
|
475
|
-
application/x-font-woff
|
476
|
-
application/x-futuresplash
|
477
|
-
application/x-gnumeric
|
478
|
-
application/x-gtar
|
479
|
-
application/x-hdf
|
480
|
-
application/xhtml+xml
|
481
|
-
application/x-java-jnlp-file
|
482
|
-
application/x-latex
|
483
|
-
application/xml
|
484
|
-
application/xml-dtd
|
485
|
-
application/x-mobipocket-ebook
|
486
|
-
application/x-msaccess
|
487
|
-
application/x-ms-application
|
488
|
-
application/x-msbinder
|
489
|
-
application/x-mscardfile
|
490
|
-
application/x-msclip
|
491
|
-
application/x-msdownload
|
492
|
-
application/x-msmediaview
|
493
|
-
application/x-msmetafile
|
494
|
-
application/x-msmoney
|
495
|
-
application/x-mspublisher
|
496
|
-
application/x-msschedule
|
497
|
-
application/x-msterminal
|
498
|
-
application/x-ms-wmd
|
499
|
-
application/x-ms-wmz
|
500
|
-
application/x-mswrite
|
501
|
-
application/x-ms-xbap
|
502
|
-
application/x-netcdf
|
503
|
-
application/xop+xml
|
504
|
-
application/x-pkcs12
|
505
|
-
application/x-pkcs7-certificates
|
506
|
-
application/x-pkcs7-certreqresp
|
507
|
-
application/x-rar-compressed
|
508
|
-
application/x-sh
|
509
|
-
application/x-shar
|
510
|
-
application/x-shockwave-flash
|
511
|
-
application/x-silverlight-app
|
512
|
-
application/xslt+xml
|
513
|
-
application/xspf+xml
|
514
|
-
application/x-stuffit
|
515
|
-
application/x-stuffitx
|
516
|
-
application/x-sv4cpio
|
517
|
-
application/x-sv4crc
|
518
|
-
application/x-tar
|
519
|
-
application/x-tcl
|
520
|
-
application/x-tex
|
521
|
-
application/x-texinfo
|
522
|
-
application/x-tex-tfm
|
523
|
-
application/x-ustar
|
524
|
-
application/xv+xml
|
525
|
-
application/x-wais-source
|
526
|
-
application/x-x509-ca-cert
|
527
|
-
application/x-xfig
|
528
|
-
application/x-xpinstall
|
529
|
-
application/yang
|
530
|
-
application/yin+xml
|
531
|
-
application/zip
|
532
|
-
audio/adpcm
|
533
|
-
audio/basic
|
534
|
-
audio/midi
|
535
|
-
audio/mp4
|
536
|
-
audio/mpeg
|
537
|
-
audio/ogg
|
538
|
-
audio/vnd.dece.audio
|
539
|
-
audio/vnd.digital-winds
|
540
|
-
audio/vnd.dra
|
541
|
-
audio/vnd.dts
|
542
|
-
audio/vnd.dts.hd
|
543
|
-
audio/vnd.lucent.voice
|
544
|
-
audio/vnd.ms-playready.media.pya
|
545
|
-
audio/vnd.nuera.ecelp4800
|
546
|
-
audio/vnd.nuera.ecelp7470
|
547
|
-
audio/vnd.nuera.ecelp9600
|
548
|
-
audio/vnd.rip
|
549
|
-
audio/webm
|
550
|
-
audio/x-aac
|
551
|
-
audio/x-aiff
|
552
|
-
audio/x-mpegurl
|
553
|
-
audio/x-ms-wax
|
554
|
-
audio/x-ms-wma
|
555
|
-
audio/x-pn-realaudio
|
556
|
-
audio/x-pn-realaudio-plugin
|
557
|
-
audio/x-wav
|
558
|
-
chemical/x-cdx
|
559
|
-
chemical/x-cif
|
560
|
-
chemical/x-cmdf
|
561
|
-
chemical/x-cml
|
562
|
-
chemical/x-csml
|
563
|
-
chemical/x-xyz
|
564
|
-
image/bmp
|
565
|
-
image/cgm
|
566
|
-
image/g3fax
|
567
|
-
image/gif
|
568
|
-
image/ief
|
569
|
-
image/jpeg
|
570
|
-
image/ktx
|
571
|
-
image/png
|
572
|
-
image/-portable-bitmap
|
573
|
-
image/prs.btif
|
574
|
-
image/svg+xml
|
575
|
-
image/tiff
|
576
|
-
image/vnd.adobe.photoshop
|
577
|
-
image/vnd.dece.graphic
|
578
|
-
image/vnd.djvu
|
579
|
-
image/vnd.dvb.subtitle
|
580
|
-
image/vnd.dxf
|
581
|
-
image/vnd.fastbidsheet
|
582
|
-
image/vnd.fpx
|
583
|
-
image/vnd.fst
|
584
|
-
image/vnd.fujixerox.edmics-mmr
|
585
|
-
image/vnd.fujixerox.edmics-rlc
|
586
|
-
image/vnd.ms-modi
|
587
|
-
image/vnd.net-fpx
|
588
|
-
image/vnd.wap.wbmp
|
589
|
-
image/vnd.xiff
|
590
|
-
image/webp
|
591
|
-
image/x-cmu-raster
|
592
|
-
image/x-cmx
|
593
|
-
image/x-freehand
|
594
|
-
image/x-icon
|
595
|
-
image/x-pcx
|
596
|
-
image/x-pict
|
597
|
-
image/x-portable-anymap
|
598
|
-
image/x-portable-graymap
|
599
|
-
image/x-portable-pixmap
|
600
|
-
image/x-rgb
|
601
|
-
image/x-xbitmap
|
602
|
-
image/x-xpixmap
|
603
|
-
image/x-xwindowump
|
604
|
-
imag/vnd.dwg
|
605
|
-
message/rfc82
|
606
|
-
mode/iges
|
607
|
-
model/mesh
|
608
|
-
model/vnd.collada+xml
|
609
|
-
model/vnd.dwf
|
610
|
-
model/vnd.gdl
|
611
|
-
model/vnd.mts
|
612
|
-
model/vnd.vtu
|
613
|
-
model/vn.gtw
|
614
|
-
model/vrml
|
615
|
-
text/calendar
|
616
|
-
text/css
|
617
|
-
text/csv
|
618
|
-
text/html
|
619
|
-
text/n3
|
620
|
-
text/plain
|
621
|
-
text/plain-bas
|
622
|
-
text/prs.lines.tag
|
623
|
-
text/richtex
|
624
|
-
text/sgml
|
625
|
-
text/tab-separated-values
|
626
|
-
text/troff
|
627
|
-
text/turtle
|
628
|
-
text/uri-list
|
629
|
-
text/vnd.crl.scurl
|
630
|
-
text/vnd.curl
|
631
|
-
text/vnd.curl.dcurl
|
632
|
-
text/vnd.curl.mcurl
|
633
|
-
text/vnd.fly
|
634
|
-
text/vnd.fmi.flexstor
|
635
|
-
text/vnd.graphviz
|
636
|
-
text/vnd.in3d.3dml
|
637
|
-
text/vnd.in3d.spot
|
638
|
-
text/vnd.sun.j2me.app-descriptor
|
639
|
-
text/vnd.wap.wml
|
640
|
-
text/vnd.wap.wmlscript
|
641
|
-
text/x-asm
|
642
|
-
text/x-c
|
643
|
-
text/x-fortran
|
644
|
-
text/x-java-source,java
|
645
|
-
text/x-pascal
|
646
|
-
text/x-setext
|
647
|
-
text/x-uuencode
|
648
|
-
text/x-vcalendar
|
649
|
-
text/x-vcard
|
650
|
-
text/yaml
|
651
|
-
video/3gpp
|
652
|
-
video/3gpp2
|
653
|
-
video/h261
|
654
|
-
video/h263
|
655
|
-
video/h264
|
656
|
-
video/jpeg
|
657
|
-
video/jpm
|
658
|
-
video/mj2
|
659
|
-
video/mp4
|
660
|
-
video/mpeg
|
661
|
-
video/ogg
|
662
|
-
video/quicktime
|
663
|
-
video/vnd.dece.mobile
|
664
|
-
video/vnd.dece.pd
|
665
|
-
video/vnd.dece.sd
|
666
|
-
video/vnd.dece.video
|
667
|
-
video/vnd.dec.hd
|
668
|
-
video/vnd.fvt
|
669
|
-
video/vnd.mpegurl
|
670
|
-
video/vnd.ms-playready.media.pyv
|
671
|
-
video/vnd.uvvu.mp4
|
672
|
-
video/vnd.vivo
|
673
|
-
video/webm
|
674
|
-
video/x-f4v
|
675
|
-
video/x-fli
|
676
|
-
video/x-flv
|
677
|
-
video/x-m4v
|
678
|
-
video/x-ms-asf
|
679
|
-
video/x-msvieo
|
680
|
-
video/x-ms-wm
|
681
|
-
video/x-ms-wmv
|
682
|
-
video/x-ms-wmx
|
683
|
-
video/x-ms-wvx
|
684
|
-
video/x-sgi-movie
|
685
|
-
x-conference/x-cooltalk
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aranha/selenium/driver_factory'
|
4
|
-
|
5
|
-
module Aranha
|
6
|
-
module Selenium
|
7
|
-
class Session < ::SimpleDelegator
|
8
|
-
attr_reader :downloads, :wait
|
9
|
-
|
10
|
-
def initialize(options = {})
|
11
|
-
@downloads = Downloads.new
|
12
|
-
@wait = ::Selenium::WebDriver::Wait.new(timeout: 15)
|
13
|
-
super(
|
14
|
-
::Aranha::Selenium::DriverFactory.create_driver(
|
15
|
-
options.merge(download_dir: @downloads.dir)
|
16
|
-
)
|
17
|
-
)
|
18
|
-
end
|
19
|
-
|
20
|
-
def find_or_not_element(find_element_args)
|
21
|
-
r = find_elements(find_element_args)
|
22
|
-
r.any? ? r.first : nil
|
23
|
-
end
|
24
|
-
|
25
|
-
def wait_for_click(find_element_args)
|
26
|
-
wait.until do
|
27
|
-
element = find_element(find_element_args)
|
28
|
-
element ? element_click(element) : nil
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def wait_for_element(find_element_args)
|
33
|
-
wait.until { find_element(find_element_args) }
|
34
|
-
end
|
35
|
-
|
36
|
-
def wait_for_download
|
37
|
-
initial_downloads = downloads.current
|
38
|
-
yield
|
39
|
-
new_downloads = []
|
40
|
-
wait.until do
|
41
|
-
new_downloads = downloads.current - initial_downloads
|
42
|
-
new_downloads.any?
|
43
|
-
end
|
44
|
-
new_downloads.first
|
45
|
-
end
|
46
|
-
|
47
|
-
def current_source
|
48
|
-
element = find_element(xpath: '/html[1]')
|
49
|
-
raise 'Root element not found' unless element
|
50
|
-
|
51
|
-
s = element.attribute('innerHTML')
|
52
|
-
"<html>\n#{s}\n</html>\n"
|
53
|
-
end
|
54
|
-
|
55
|
-
class Downloads
|
56
|
-
attr_reader :dir
|
57
|
-
|
58
|
-
def initialize
|
59
|
-
@dir = ::Dir.mktmpdir
|
60
|
-
end
|
61
|
-
|
62
|
-
def current
|
63
|
-
Dir.glob("#{dir}/**/*")
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def element_click(element)
|
70
|
-
element.click
|
71
|
-
element
|
72
|
-
rescue ::Selenium::WebDriver::Error::ElementClickInterceptedError,
|
73
|
-
::Selenium::WebDriver::Error::ElementNotInteractableError
|
74
|
-
nil
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|