1

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.

I have this code:

 @name = page.css("#content").css("a")[1]

Which gives this result

<a href="/define.php?term=generation%20xerox&amp;defid=7167814">generation xerox</a>

I want to get at the "generation xerox" bit

I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work

Thanks in advance all

4

1 回答 1

2

您可以访问标签@name.text和链接@name['href']

文档

于 2013-09-14T08:32:45.037 回答