Return just the value of an xpath - Nokogiri Ruby -


i'm using xpath values on website this

auction_page = nokogiri::html open(a, "user-agent" => theagent) auction_links = auction_page.xpath('//iframe[contains(@src, "near")]/@src') 

which returns need this

#<nokogiri::xml::attr:0x3fcd7bef5730 name="src" value="http://thevalue.com"> 

i want value, not value or else. how do this?

i think looking .text method.

so auction_links.text should return "http://thevalue.com".

edit:

if doesn't work try, auction_links.first return array, i'm sure link inside there. ; )

for further reference, here great tutorial basic nokogiri crawling/parsing.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -