How to get the values href values rather than the anchor tags?
I've just gotten started with HtmlAgilityPack and I've run into an issue.
My code is:
var urls = html.DocumentNode.SelectNodes("//a[contains(@href, 'watch?v=')");
Currently I'm getting returned an array of anchor tags. The thing is that
I'd like to get returned an array of strings instead (each containing the
href value of the anchor tag). How would I do this?
Btw I know I could loop through them all afterwards and get the hrefs but
I'd like to do this in one line through Xpath.
No comments:
Post a Comment