Merge pull request #391 from theofpa/master

Ignore xmlns when evaluating xpath

Andrew Cantino лет %!s(int64=10): %!d(string=назад)
Родитель
Сommit
c7e29492c9
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      app/models/agents/website_agent.rb

+ 1 - 0
app/models/agents/website_agent.rb

@@ -157,6 +157,7 @@ module Agents
157 157
                 when css = extraction_details['css']
158 158
                   nodes = doc.css(css)
159 159
                 when xpath = extraction_details['xpath']
160
+                  doc.remove_namespaces! # ignore xmlns, useful when parsing atom feeds
160 161
                   nodes = doc.xpath(xpath)
161 162
                 else
162 163
                   error '"css" or "xpath" is required for HTML or XML extraction'