Greetings to all…
When i run the below code , i get the below error
undefined method `each’ for
{“src”=>“Capture/12201010081441205.jpg”}:Hpricot::Attributes
source code
<%@a = File.read("#{@file_path}")%>
<%@html = Hpricot.parse("#{@a}")%>
<[email protected]("//img").each do |element|%>
<%element.attributes.each do |key ,value|%>
<%dir_name = File.dirname("#{value}")%>
<%end%>
<%end%>
Any help would be greatly appreciated