将htmlagilitypack节点转换为htmlelement .net [英] convert htmlagilitypack node to htmlelement .net

查看:81
本文介绍了将htmlagilitypack节点转换为htmlelement .net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用htmlagilitypack从html中提取所有链接作为htmlnode
文档,但是我需要从htmlelement
函数中返回它

I have just used htmlagilitypack to extract all link as htmlnode from an html
document, but i need this returned from my function as htmlelement

Dim Tags As HtmlNodeCollection = docNode.SelectNodes(strXpath)
  Dim ListResult As New List(Of HtmlElement)
  For Each Tag As HtmlNode In Tags
     ListResult.Add(Tag.Element)
 Next
Return Nothing



我该怎么做?



How can i do this?

推荐答案

如果您的代码正确并且可以编译,您没有提到什么,为什么不直接返回ListResult呢?而不是什么都不退回;

只是说而已.

问候,

曼弗雷德(Manfred)
If your code is correct and compiles, what you failed to mention, why not just do Return ListResult; instead of Return Nothing;

Just saying.

Regards,

Manfred


这篇关于将htmlagilitypack节点转换为htmlelement .net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆