[C#爬蟲_HtmlAgilityPack使用]_如何透過C#爬蟲批量將當前網頁圖片全下載下來

一個網頁上若要去捕抓下載所有png , jpg , gif的圖檔 此時就要透過網頁爬蟲(web crawler) 在此我們透過C#搭配vs2019 和HtmlAgilityPack這個套件進行開發 HtmlAgilityPack套件 https://html-agility-pack.net/ 授權採用 MIT license nuget上也可直接配置安裝 首先aspx網頁介面部分 WebForm1.aspx 程式碼 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 < %@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ScrapApp.WebForm1" %> <!DOCTYPE html> <html xmlns= "http://www.w3.org/1999/xhtml" > <head runat= "server" > <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> <title></title> <style type= "text/css" > #TextArea1 { height : 458px ; width : 976px ; } </style> </head> <body> <form id= "form1" runat= "server" > <d...