Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Commit

Permalink
Fixed the XPath/CSS-path expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Sep 7, 2010
1 parent db561e5 commit 28d03ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/shodan/query.rb
Expand Up @@ -225,7 +225,7 @@ def page(index)
Page.new do |new_page|
doc = @agent.get(page_url(index))

doc.search('#search/div.result').each do |result|
doc.search('#search//div.result').each do |result|
div = result.at('div')

ip = if (a = div.at('a'))
Expand All @@ -234,11 +234,11 @@ def page(index)
div.children.first.inner_text
end

hostname = if (host_node = result.at('div/a:last'))
hostname = if (host_node = div.at('a:last'))
host_node.inner_text
end

date = result.at('div/span').inner_text.scan(/\d+\.\d+\.\d/).first
date = div.at('span').inner_text.scan(/\d+\.\d+\.\d/).first
response = result.at('p').inner_text.strip

new_page << Host.new(ip,date,response,hostname)
Expand Down

0 comments on commit 28d03ec

Please sign in to comment.