lib/scrap_kit/recipe.rb in scrap_kit-0.1.5 vs lib/scrap_kit/recipe.rb in scrap_kit-0.1.6
- old
+ new
@@ -43,13 +43,13 @@
remainder.each do |item|
elements = elements.elements(css: item)
end
elements.filter do |element|
- condition_key = condition.keys[0].to_s
- condition_value = condition.values[0]
+ condition_key = condition.keys.first.to_s
+ condition_value = condition.values.first
found_element = element.element(css: condition_key)
- extract_value_from_element(found_element)&.match(condition_value)
+ extract_value_from_element(found_element) == condition_value
end
end
end
def extract_value_from_element(element)