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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -