ruby on rails - Got the right node with Nokogiri, but need to search further -
i using this.
doc = nokogiri::html(open(url)) pic = doc.search "[text()*='hires']"
to script node:
<script type="text/javascript"> var data = { 'colorimages': { 'initial': [{"hires":"http://ecx.images-joes.com/images /i/71mbtep1w9l._ul1500_.jpg","thumb":"http://ecx.images-joes.com/images /i/41xe2xadivl._us40_.jpg","large":"http://ecx.images-joes.com/images /i/41xe2xadivl.jpg","main":{"http://ecx.images-joes.com/images /i/71mbtep1w9l._ux395_.jpg":[395,260],"http://ecx.images-joes.com/images /i/71mbtep1w9l._ux500_.jpg":[500,329],"http://ecx.images-joes.com/images /i/71mbtep1w9l._ux535_.jpg":[535,352],"http://ecx.images-joes.com/images /i/71mbtep1w9l._ux575_.jpg":[575,379]}
and node keeps going there..
but thing need pull out entire url contains string. "ul1500" or url follows "hires:".. ex. http://ecx.images-joes.com/images/i/71mbtep1w9l.ul1500.jpg
i looked class nokogiri returns, , nokogiri::xml::nodeset
but i'm not sure how interact in order need?
thanks
i went using nokogiri regex expression.. ended finding , worked magic!!
Comments
Post a Comment