HtmlAgilityPack HtmlWeb.Load() 不支持 gzip 的解决方法

网友投稿 253 2022-11-21

HtmlAgilityPack HtmlWeb.Load() 不支持 gzip 的解决方法

_htmlWeb = new HtmlWeb(); HtmlWeb.PreRequestHandler handler = delegate (HttpWebRequest request) { request.Headers[HttpRequestHeader.AcceptEncoding] = "gzip, deflate"; request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip; request.CookieContainer = new System.Net.CookieContainer(); return true; }; _htmlWeb.PreRequest += handler;

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java 如何实现照片转化为回忆中的照片
下一篇:如何从远程医疗的角度选择PAN或WAN接口
相关文章

 发表评论

暂时没有评论,来抢沙发吧~