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!!

https://stackoverflow.com/a/5939906/4386626


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -