I’m trying to extract the answer text on the following webpage. I opened up the DOM inspector and got the class of the text as "answer_content". I’ve defined a method that looks like:
def get_answer()
@browser.div(:class, "answer_content")
end
puts page.get_answer.text
However, this prints an empty spring. Did I identify the wrong element? When I look at it in the DOM inspector, there does seem to be nothing in between the divs.
Looks to me that there are more than one
divelements with thatclass. This will tell you if my guess was correct: