HtmlAgilityPack returning random characters
See the question and my original answer on StackOverflowThis has nothing to do with Html Agility Pack, it's because you have set AllowAutoRedirect
to false. Remove it and it will work. The site apparently does a redirect, you need to follow it if you want the final HTML text.
Note the Html Agility Pack has a utility HtmlWeb
class that can download file directly as an HmlDocument
:
HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load(@"http://www.asos.com/ASOS/ASOS-Sweatshirt-With-Contrast-Ribs/Prod/pgeproduct.aspx?iid=2765751&cid=14368&sh=0&pge=0&pgesize=20&sort=-1&clr=Red");