Skip to content

Instantly share code, notes, and snippets.

@tsaiid
Created April 7, 2017 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsaiid/276050e6f3e0393433df43df295d22f0 to your computer and use it in GitHub Desktop.
Save tsaiid/276050e6f3e0393433df43df295d22f0 to your computer and use it in GitHub Desktop.
result = Wombat.crawl do
base_url "https://www.rsroc.org.tw/"
path "News/"
posts 'xpath=//*[@id="page_right"]/table[2]/tr', :iterator do
title 'xpath=td[1]'
url 'xpath=td/a/@href'
date 'xpath=td[2]'
content 'xpath=td/a', :follow do |c|
c.html 'xpath=//*[@id="page_right"]/table[2]/tr[3]/td/div', :html
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment