how to crawler to save mp3 urls in asp.net mvc web application -
i want create application can crawl different websites , collect mp3 urls on basis of given query.
user can search song title if results available in database show related song url otherwise crawl websites , find related result save in database , shows resutls user.
i give htmlagilitypack go (you can install using package manager).
a simple example of how start:
string url = "http://www.google.com"; htmlweb web = new htmlweb(); htmldocument doc = web.load(url);
when have loaded document, can inspect it:
foreach (htmlnode node in doc.documentnode.selectnodes("//a[@href]")) { if (node.attributes.contains("href")) { console.writeline(node.attributes["href"].value); } }
the above should print urls can find anchors.
Comments
Post a Comment