class Apollo::Crawler::GoogleCrawler
Public Instance Methods
extract_data(doc)
click to toggle source
# File lib/apollo_crawler/crawler/google_crawler.rb, line 36 def extract_data(doc) res = doc.xpath(@@MATCHER_ITEM).map { | node | url = BaseCrawler.try_get_url(self.url, node['href']).to_s next if url.nil? { :text => node.text, :link => url } } end
extract_links(doc)
click to toggle source
# File lib/apollo_crawler/crawler/google_crawler.rb, line 48 def extract_links(doc) res = doc.xpath("(//td[@class = 'b']/a)[last()]").map { | node | res_doc = BaseCrawler.try_get_url(self.url, node['href']).to_s next if url.nil? { :link => url } } end
name()
click to toggle source
# File lib/apollo_crawler/crawler/google_crawler.rb, line 28 def name() return "Google" end
url()
click to toggle source
# File lib/apollo_crawler/crawler/google_crawler.rb, line 32 def url() return "http://www.google.com/search?q=ruby" end