ferrumwizard 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/ferrumwizard.rb +11 -5
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16a5b0bedff31cf75df672bb9234b30104006eb2353bc2a035d9a4cb06cce082
|
4
|
+
data.tar.gz: eb674866a070802be1c2009d8a7389d0798ae2010521b8370e62bbe780fc65aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3fd5d76a5aff19304d9d64e91b37089b7a703a0067f41918ab50159643cee556e2adaddf1cc41f11c38d9081c658a42d428709d9ddf5ddc09d71b86ced5f0aa
|
7
|
+
data.tar.gz: d1ca5d86310e6d1b1e278fa0c47969045c729a650d49e515c47c11e66ebca9ea0fc14c2b08f18074433ab9134869286fe9970e606729d43f775c571864c60c3a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/ferrumwizard.rb
CHANGED
@@ -5,9 +5,11 @@
|
|
5
5
|
require 'yaml'
|
6
6
|
require 'rexle'
|
7
7
|
require 'ferrum'
|
8
|
+
require 'rxfhelper'
|
8
9
|
|
9
10
|
|
10
11
|
class FerrumWizard
|
12
|
+
include RXFHelperModule
|
11
13
|
|
12
14
|
attr_reader :browser, :links, :radio, :buttons, :js_methods
|
13
15
|
|
@@ -16,11 +18,12 @@ class FerrumWizard
|
|
16
18
|
|
17
19
|
@url, @debug = url, debug
|
18
20
|
@browser = Ferrum::Browser.new headless: headless, timeout: timeout
|
19
|
-
|
21
|
+
|
22
|
+
loadx(cookies) if cookies
|
20
23
|
|
21
24
|
if url then
|
22
25
|
|
23
|
-
|
26
|
+
sleep 3
|
24
27
|
|
25
28
|
@browser.goto(@url)
|
26
29
|
@browser.network.wait_for_idle
|
@@ -47,16 +50,19 @@ class FerrumWizard
|
|
47
50
|
# url='https://somewebsite.com'
|
48
51
|
# fw.browser.goto(url)
|
49
52
|
#
|
50
|
-
def load_cookies(
|
53
|
+
def load_cookies(raws)
|
54
|
+
|
55
|
+
s = raws.lines.length > 1 ? raws : FileX.read(raws)
|
56
|
+
puts 's: ' + s.inspect if @debug
|
51
57
|
|
52
|
-
rawcookies = YAML.load(
|
58
|
+
rawcookies = YAML.load(s)
|
53
59
|
|
54
60
|
rawcookies.each do |h|
|
55
61
|
|
56
62
|
if @debug then
|
57
63
|
puts 'name: ' + h['name']
|
58
64
|
puts 'h: ' + h.inspect
|
59
|
-
sleep 0.
|
65
|
+
sleep 0.4
|
60
66
|
end
|
61
67
|
|
62
68
|
browser.cookies.set(name: h['name'], value: h['value'],
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ferrumwizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
FK+cyrQNA9DLJYJuz6uO7Z+gXZWjwAO38LUwF01w49asSv/5ZH2HH/EauX5xWpe+
|
36
36
|
ry6lYQlb8j50Iys5elAy1p0i
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-
|
38
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|