fe_core_ext 0.32.1 → 0.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fe_core_ext/gem_ext/ferrum.rb +12 -4
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e03934108a512eada22df20a49377eacbcc98decb4cf1ef976a6b4a68625d878
|
4
|
+
data.tar.gz: 47c126a960a3c00b535ad7c0de71a00dd891bf1c3df80a25e252376ea0c32bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0237b7d187495a4362e7cd499cafefd9ac5a4ba0092a7e6988c98cccfeef01c6022a6e7f175dc2224d24f768cf513ee7d478bab6cfd84042d58dd6b06e88d01
|
7
|
+
data.tar.gz: 0e2294134a6b53bbe9cebd60e311549220559429ac5586b02914ce036d34948df94e13a279b9b63ed70f833441169c2f637eb3f2fbdae4bfdf705120dd01a634
|
@@ -2,15 +2,23 @@
|
|
2
2
|
|
3
3
|
module Ferrum
|
4
4
|
class Browser
|
5
|
-
delegate
|
5
|
+
delegate %i[wait_for_css wait_for_csses wait_for_xpath wait_for_xpaths], to: :page
|
6
6
|
end
|
7
7
|
|
8
8
|
class Page
|
9
|
-
delegate
|
9
|
+
delegate %i[wait_for_css wait_for_csses wait_for_xpath wait_for_xpaths], to: :main_frame
|
10
10
|
end
|
11
11
|
|
12
12
|
class Frame
|
13
13
|
module DOM
|
14
|
+
def wait_for_csses(selector, timeout: 3)
|
15
|
+
wait_for_selector(selector, :css, timeout)
|
16
|
+
end
|
17
|
+
|
18
|
+
def wait_for_xpaths(selector, timeout: 3)
|
19
|
+
wait_for_selector(selector, :xpath, timeout)
|
20
|
+
end
|
21
|
+
|
14
22
|
def wait_for_css(selector, timeout: 3)
|
15
23
|
wait_for_selector(selector, :at_css, timeout)
|
16
24
|
end
|
@@ -24,8 +32,8 @@ module Ferrum
|
|
24
32
|
def wait_for_selector(selector, selector_method, timeout)
|
25
33
|
interval = 0.1
|
26
34
|
(timeout / interval).to_i.times do
|
27
|
-
|
28
|
-
return
|
35
|
+
nodes = send(selector_method, selector)
|
36
|
+
return nodes if nodes
|
29
37
|
sleep(interval)
|
30
38
|
end
|
31
39
|
nil
|
data/lib/fe_core_ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fe_core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.33.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|