# Scrape rankings Google

**URL:** <https://www.ruby-forum.com/t/scrape-rankings-google/159230>\
**Category:** Rails\
**Created:** [February 2, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/scrape-rankings-google/159230 "2009-02-02T16:52:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [February 2, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/scrape-rankings-google/159230/1 "2009-02-02T16:52:41Z")

</div>

Hi,

i use the code to scrape google search results.

require ‘rubygems’  
require ‘scrubyt’

google\_data = Scrubyt::Extractor.define do  
fetch ‘[http://www.google.nl/](http://www.google.nl/)’  
fill\_textfield ‘q’, ‘ticket’  
submit

link\_title “//a[@class=‘l’]”, :write\_text =\> true do  
link\_url

end  
end

p google\_data.to\_hash

This output:

[{:link\_url=\>“[http://www.ticketmaster.nl/](http://www.ticketmaster.nl/)”,  
:link\_title=\>“Ticketmaster.nl: Welkom”}

The next thing is to store the ranking based on their position
