Hi,
I would like to know how to retrieve the value of an attribute.
For example (doc/".nom/a") will return an array of elements. I would
like to know the value of the href attribut of each element.
thanks for your help
Hi,
I would like to know how to retrieve the value of an attribute.
For example (doc/".nom/a") will return an array of elements. I would
like to know the value of the href attribut of each element.
thanks for your help
elems = doc.search("//a")
elems.each do |elem|
p elem.get_attribute(“href”)
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs