how to download image using html agility pack

c# html-agility-pack parsing xpath

Question

i have seen further question answers but cannot get a clear answer.

foreach (HtmlNode cat2 in doci.DocumentNode.SelectNodes(".//a/@href | //img/@src"))

in this i am getting src in img tag i want to download that image and store it into database.what should i do? is it possible with html agility pack to download image if so, then tell me how to get and assign it to a variable then i can store in my DB

var imagePath = cat2.Attributes["src"].Value;

this is not working too

1
-1
4/12/2016 7:37:02 PM

Accepted Answer

The code you have write will only get the link of the image and u can save it in your DB and then make a client use that stored URL of the image and then u can download the image thanks

-1
4/22/2016 5:37:33 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow