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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd2924b0ba55e1d73238b17b4bf15b6fb36a8df61910e8af0a5876ed44ada36a
4
- data.tar.gz: 897da113e002b93980a735beb87138f73b39cf2f3961d267c99bba291d6553b6
3
+ metadata.gz: 06df78782e4cc3aa25ed9f90c1536d935c3fcd08bae82b33e4d79e68e805a09d
4
+ data.tar.gz: ddee1afb1a30778818f1b688d8880b5c383f804e8fc8660be89461c98730f869
5
5
  SHA512:
6
- metadata.gz: fb70c2d388c38e8f1b7a42f31ab661d8e277fffbba6750e774d89c34d7ef6ac277eaefe6b17a83924cc8f41e9deb61c280839f673388a7b55310d024b554df84
7
- data.tar.gz: 9dfe5f761476abb11ac5e19e905f88694aade27d52e2cea7bbf92dd3cece6dda9cd62a41f0bdff25509dbad321435c907d005e276319b2e9dce05d3ab9b7daf1
6
+ metadata.gz: 90097dfa2f36f4379117d8487046acdeef98d257f89ca6041064e5d0a3305b52e034a6cacb4d29f1cf1d909afb302dfdd2cd2c6ab7b01755786585dbb217a554
7
+ data.tar.gz: f0b8e7a588ac8d195d078af941a335913d547aac7232a3fa473f5b43b55f898e4ed12d28da3ea3488f3d390e43ac561500c585fc030d31ecf1779b9006869227
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scrap_kit (0.1.3)
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.0)
48
+ zeitwerk (2.3.1)
49
49
 
50
50
  PLATFORMS
51
51
  ruby
@@ -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&.text_content&.match(condition_value)
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)&.text_content
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]
@@ -1,3 +1,3 @@
1
1
  module ScrapKit
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-06-19 00:00:00.000000000 Z
11
+ date: 2020-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler