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":

enter image description here

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(); 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)