Hel*_*rld 1 c# vb.net html-agility-pack
为什么我会收到此错误?
"道路上的非法人物"在
htmlDoc.Load(pageSource)
pageSource是HTML页面的字符串变量.我需要将页面源作为字符串传递,而不是作为文件而不是URL.我该怎么做呢?
Dim ids As New List(Of String)()
Dim pageSource = getHtml(url)
Dim htmlDoc As HtmlDocument = New HtmlDocument()
htmlDoc.OptionFixNestedTags = True
htmlDoc.Load(pageSource)
Dim s As HtmlNodeCollection = htmlDoc.DocumentNode.SelectNodes("//div/@id")
For Each div As HtmlNode In s
ids.Add(div.Id)
Next
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2831 次 |
| 最近记录: |