how can I download all the linked mp3s from a web page?
example html
<a href="http://test.com/linkofmusic1.mp3" download="Song.mp3">
<a href="http://test.com/linkosong2.mp3" download="music2.mp3">
how can I download all the linked mp3s from a web page?
example html
<a href="http://test.com/linkofmusic1.mp3" download="Song.mp3">
<a href="http://test.com/linkosong2.mp3" download="music2.mp3">
You can use HtmlAgilityPack to get all the link with href having .mp3 extension
Example:
HtmlDocument doc = new HtmlDocument();
doc.Load("file.htm");
List<string> mp3Links = new List<string();
foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
{
if(link != null)
{
if(link["href"].EndsWith(".mp3"))
{
mp3Links.Add(link["href"].Value);
}
}
}