Html Agility Pack 处理通配符
程序员文章站
2023-12-12 21:45:58
html agility pack 处理通配符
let doc = new htmlagilitypack.htmldocument()
doc.loadhtml( html )
=====...
html agility pack 处理通配符
let doc = new htmlagilitypack.htmldocument()
doc.loadhtml( html )
========
let url = "https://site.site.site"
let html = new htmlagilitypack.htmlweb()
let doc0 = html.load ( url )
html.overrideencoding ->
let doc = html.load ( url )
doc.documentnode.selectnodes("//input")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[contains(@id, 'bt')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[contains(@name, '__')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[starts-with(@id, 'tb')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
https://www.w3school.com.cn/xpath/xpath_functions.
let doc = new htmlagilitypack.htmldocument()
doc.loadhtml( html )
========
let url = "https://site.site.site"
let html = new htmlagilitypack.htmlweb()
let doc0 = html.load ( url )
html.overrideencoding ->
let doc = html.load ( url )
doc.documentnode.selectnodes("//input")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[contains(@id, 'bt')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[contains(@name, '__')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
doc.documentnode.selectnodes("//input[starts-with(@id, 'tb')]")
|> seq.map (fun i -> i.outerhtml)
|> seq.iter (printfn "%s")
https://www.w3school.com.cn/xpath/xpath_functions.