Skip to content

Instantly share code, notes, and snippets.

@kyaido
Created May 18, 2015 14:55
Show Gist options
  • Save kyaido/3328ca4360c53c92755f to your computer and use it in GitHub Desktop.
Save kyaido/3328ca4360c53c92755f to your computer and use it in GitHub Desktop.
Yasuri sample
require 'yasuri'
agent = Mechanize.new
page = agent.get('http://www.la-viephotohawaii.com/aloha_diary/page/1404475242.html')
init_page = Yasuri.pages_init '//*[@id="prev"]' do
text_author '//*[@id="loadarea"]/div/div[3]/p[1]', truncate:/Photo by (.+)/
end
require 'json'
jj init_page.inject(agent, page)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment