Created
March 2, 2012 07:59
-
-
Save yankov/1956661 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
# can be different for your specific search | |
PAGES = 140 | |
PAGES.times do |page_num| | |
response = open("http://www.match.com/search/searchSubmit.aspx?by=radius&lid=226&cl=1&gc=2&tr=1&lage=27&uage=29&ua=29&pc=94121&dist=10&po=1&oln=0&do=2&q=woman,men,27,29,1915822078&st=quicksearch&pn=#{page_num}&rn=4", "cookie" => "SECU=VALUE_OF_THE_COOKIE") | |
doc = Nokogiri::HTML(response.read) | |
doc.xpath("//img[@class='profilePic']/..").each do |link| | |
img_src = link.xpath("img/@src").to_s.gsub('sthumbnails.match.com/sthumbnails', 'pictures.match.com/pictures') | |
puts img_src | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment