HTML敏捷包问题

编程入门 行业动态 更新时间:2024-10-27 12:33:05
本文介绍了HTML敏捷包问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 亲爱的朋友,亲爱的朋友。我的Html Agility Pack存在严重问题。请看我的代码:

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load( www.linkedin/in/ladan-sahraei-14461b34?authType=OUT_OF_NETWORK&authToken=tK-W&区域设置= EN_US&安培; srchid = 4367283831473659871577&安培; srchindex = 1&安培; srchtotal = 6693647&安培; TRK = vsrp_people_res_name&安培; trkInfo = VSRPsearchId%3A4367283831473659871577%2CVSRPtargetId%3A120972292%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Afalse%2CauthType%3AOUT_OF_NETWORK) Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode( // span [@ class ='full-name'] ) Response.Write(ournone.InnerHtml)

当我运行此代码时我有一个问题:

对象引用不是 set to object 的实例。 描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪 有关错误的更多信息,其中源自代码中的关键字>。

当我在html文件中保存页面内容并再次运行代码时效果很好。

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load( http:// localhost:21374 / HtmlPage.html) Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode( // span [@ class ='full-name']) Response.Write (mynone.InnerHtml)

有什么问题? 我尝试过: Html Agility Pack上的问题。请帮帮我

解决方案

亲爱的朋友。我的Html Agility Pack存在严重问题。请查看我的代码: 在系统工作正确但不能使用相同内容在在线网址上运行的第一个代码,并返回空值: 是工作空值!

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load( www.linkedin/in/ladan-sahraei-14461b34?authType= OUT_OF_NETWORK&安培;的authToken = TK-W&安培;语言环境= EN_US&安培; srchid = 4367283831473659871577&安培; srchindex = 1&安培; srchtotal = 6693647&安培; TRK = vsrp_people_res_name&安培; trkInfo = VSRPsearchId%3A4367283831473659871577%2CVSRPtargetId%3A120972292%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Afalse%2CauthType%3AOUT_OF_NETWORK ) Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode( // span [@ class ='full-name']) Response.Write(ournone.InnerHtml)

是工作正确!

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load( http:// localhost :21374 / HtmlPage.html) Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode( // span [@ class ='full-name']) Response.Write(ournone.InnerHtml)

hello dear friend. i have a serious problem with Html Agility Pack. please see my code:

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load("www.linkedin/in/ladan-sahraei-14461b34?authType=OUT_OF_NETWORK&authToken=tK-W&locale=en_US&srchid=4367283831473659871577&srchindex=1&srchtotal=6693647&trk=vsrp_people_res_name&trkInfo=VSRPsearchId%3A4367283831473659871577%2CVSRPtargetId%3A120972292%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Afalse%2CauthType%3AOUT_OF_NETWORK") Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode("//span[@class='full-name']") Response.Write(ournone.InnerHtml)

when i run this code i have a poblem:

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

when i save content of the page in a html file and run code again it work well.

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load("localhost:21374/HtmlPage.html") Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode("//span[@class='full-name']") Response.Write(ournone.InnerHtml)

what is problem? What I have tried: problem on Html Agility Pack. please help me

解决方案

hello dear friend. i have a serious problem with Html Agility Pack. please see my code: the first code when run on a saved file on system work correct but not work with the same content in a online url and return empty values: is work empty value!

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load("www.linkedin/in/ladan-sahraei-14461b34?authType=OUT_OF_NETWORK&authToken=tK-W&locale=en_US&srchid=4367283831473659871577&srchindex=1&srchtotal=6693647&trk=vsrp_people_res_name&trkInfo=VSRPsearchId%3A4367283831473659871577%2CVSRPtargetId%3A120972292%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Afalse%2CauthType%3AOUT_OF_NETWORK") Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode("//span[@class='full-name']") Response.Write(ournone.InnerHtml)

is work correct!

Dim Scr1 As New HtmlWeb() Dim Url1 = Scr1.Load("localhost:21374/HtmlPage.html") Dim ournone As HtmlNode = Url1.DocumentNode.SelectSingleNode("//span[@class='full-name']") Response.Write(ournone.InnerHtml)

更多推荐

HTML敏捷包问题

本文发布于:2023-11-23 08:54:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620833.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:敏捷   HTML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!