Skip to content

Instantly share code, notes, and snippets.

@yankov
Created March 2, 2012 08:07
Show Gist options
  • Save yankov/1956678 to your computer and use it in GitHub Desktop.
Save yankov/1956678 to your computer and use it in GitHub Desktop.
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