doc.xpath("//div[@id='Ci_']").each_with_index do |div,i|
parse_file.puts "#{div.at_xpath("./*[@class='class1']").text}"
parse_file.puts "#{div.at_xpath("./*[@class='class2']").text}"
There are two links in class2 and i need to extract text that belongs to these links, separately. How can I do that?
Assuming that the anchors have the class you want (and are not under a parent with that class):
If the anchors are within the class: