Created
May 18, 2015 14:55
-
-
Save kyaido/3328ca4360c53c92755f to your computer and use it in GitHub Desktop.
Yasuri sample
This file contains 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 '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