c# - Is it possible to get a list of all links with a class on a webpage? -
there lot of links on webpage.
the ones want make list of (there exactly 22) have same class
"name notranslate":
is possible list of links class? or @ least after "href"
this program written in c#.
i tried loop web.document.getelementbyid (web name of webbrowser control) did nothing.
you can use htmlagilitypack
var web = new htmlagilitypack.htmlweb(); var doc = web.load(url); var list = doc.documentnode.selectnodes("//a[@class='name notranslate']") .select(a => a.attributes["href"].value) .tolist();