scrap_kit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +2 -2
- data/lib/scrap_kit/recipe.rb +12 -2
- data/lib/scrap_kit/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: 06df78782e4cc3aa25ed9f90c1536d935c3fcd08bae82b33e4d79e68e805a09d
|
4
|
+
data.tar.gz: ddee1afb1a30778818f1b688d8880b5c383f804e8fc8660be89461c98730f869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90097dfa2f36f4379117d8487046acdeef98d257f89ca6041064e5d0a3305b52e034a6cacb4d29f1cf1d909afb302dfdd2cd2c6ab7b01755786585dbb217a554
|
7
|
+
data.tar.gz: f0b8e7a588ac8d195d078af941a335913d547aac7232a3fa473f5b43b55f898e4ed12d28da3ea3488f3d390e43ac561500c585fc030d31ecf1779b9006869227
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.4] 2020-07-12
|
4
|
+
|
5
|
+
### Changed/Added
|
6
|
+
- Add support for `<input />` elements
|
7
|
+
|
8
|
+
## [0.1.3] 2020-06-18
|
9
|
+
|
10
|
+
### Changed/Added
|
11
|
+
- Moved development dependencies as dependencies
|
12
|
+
|
3
13
|
## [0.1.2] 2020-06-18
|
4
14
|
|
5
15
|
### Changed/Added
|
@@ -9,6 +19,7 @@
|
|
9
19
|
|
10
20
|
### Changed/Added
|
11
21
|
- Update activesupport requirement from = 6.0.2.1 to = 6.0.3.1
|
22
|
+
- Update rake requirement from ~> 10.0 to ~> 13.0
|
12
23
|
|
13
24
|
## [0.1.0] 2020-02-09
|
14
25
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
scrap_kit (0.1.
|
4
|
+
scrap_kit (0.1.4)
|
5
5
|
activesupport (= 6.0.3.1)
|
6
6
|
watir (~> 6.16.5)
|
7
7
|
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
watir (6.16.5)
|
46
46
|
regexp_parser (~> 1.2)
|
47
47
|
selenium-webdriver (~> 3.6)
|
48
|
-
zeitwerk (2.3.
|
48
|
+
zeitwerk (2.3.1)
|
49
49
|
|
50
50
|
PLATFORMS
|
51
51
|
ruby
|
data/lib/scrap_kit/recipe.rb
CHANGED
@@ -47,14 +47,24 @@ module ScrapKit
|
|
47
47
|
condition_key = condition.keys[0].to_s
|
48
48
|
condition_value = condition.values[0]
|
49
49
|
found_element = element.element(css: condition_key)
|
50
|
-
found_element&.
|
50
|
+
extract_value_from_element(found_element)&.match(condition_value)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
def extract_value_from_element(element)
|
56
|
+
if element&.respond_to?(:tag_name)
|
57
|
+
if element.tag_name.downcase == "input"
|
58
|
+
return element.attribute_value(:value)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
element&.text_content
|
63
|
+
end
|
64
|
+
|
55
65
|
def extract_attribute(browser_or_element, selector_or_hash)
|
56
66
|
if selector_or_hash.is_a?(String)
|
57
|
-
browser_or_element.element(css: selector_or_hash)
|
67
|
+
extract_value_from_element(browser_or_element.element(css: selector_or_hash))
|
58
68
|
elsif selector_or_hash.is_a?(Hash)
|
59
69
|
selector = selector_or_hash[:selector]
|
60
70
|
selector_for_children_attributes = selector_or_hash[:children_attributes]
|
data/lib/scrap_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrap_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Leon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|