我正在從網頁上的圖像提取軟件工作。已經創建了一個功能圖像提取:uri太長
public static void GetAllImages()
{
WebClient x = new WebClient();
string source = x.DownloadString(@"http://www.bbc.com");
var document = new HtmlWeb().Load(source);
var urls = document.DocumentNode.Descendants("img")
.Select(e => e.GetAttributeValue("src", null))
.Where(s => !String.IsNullOrEmpty(s));
document.Load(source);
}
它說:「URI過長」 ..
我試圖用Uri.EscapeDataString。但沒有得到知道在哪裏把它
任何幫助,將讚賞
凡/時,它說,烏里太長? – Richard
on var document = new HtmlWeb()。Load(source); –
我敢打賭,HtmlWeb.Load將Uri作爲其參數,同時爲您提供整個頁面內容。 也請爲您的問題添加HtmlWeb類的描述。你可能正在使用一些第三方庫。 –