c# how to download html which loads using ajax

两盒软妹~` 提交于 2019-12-13 09:58:52

问题


now a days there are web pages which developed using some ajax based frameworks (dynamically or lazy loading). Just wondering if there is any way to download html contents of such pages as when i try to download using htmlAgilityPack but all i get is header and empty body part but when i try to inspect element then only i can see proper htmls/div but of that page when i try to look into view source i see empty body...

is there any third party like htmlAgilityPack or any other way?


回答1:


You would need to be able to run the js that is inside. Which according to this answer is not possible with htmlAgilityPack.




回答2:


You can see it.Getting web content by Html Agility Pack.https://code.msdn.microsoft.com/Getting-web-content-by-bb07d17d...



来源:https://stackoverflow.com/questions/31951090/c-sharp-how-to-download-html-which-loads-using-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!