I want to get the next element text by previous I'm doing like this
property_doc = Nokogiri::HTML(open(my_url))
address = property_doc.xpath('//section[@class="container"]/dl/dt[contains(text(), "Address")]').next_element.text
but error
occurred undefined method 'next_element' for #<Nokogiri::XML::DTD:0x....>
I want to next element text which is showing at html
:
<section class="container">
<dl>
<dt>Address</dt>
<dd class="">550 Seagaze Dr<br>Oceanside CA 92054 </dd>
</dl>
</section>
Aucun commentaire:
Enregistrer un commentaire