[Rails] Hpricot Parser
Dear Friends,
In my html page i have image tags like below.
<img src="family/occasion.jpg" />
<img src="office/1220100223113830171.jpg" />
<img src="family/gettogether.jpg" />
Using the hpricot parser like below i can able to get all the image tag
and its attributes.
<%@a = File.read("#{@file_path}")%>
<%@html = Hpricot.parse("#{@a}")%>
<%@html.search("//img").each do |element|%>
<%end%>
but now i want to get all the images which has "family" as a image
path.so i want to fetch only the below images
<img src="family/occasion.jpg" />
<img src="office/1220100223113830171.jpg" />
Is it possible to do so...
Thanks for your time
kindly support me.
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home