且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用HtmlAgilityPack和Json解析网页

更新时间:2023-12-05 18:16:10

我认为您只是忘记了在xpath表达式中将'a'标记替换为'script'标记.我目前无法在代码中进行验证,但是您可以使用chrome dev工具通过期望并在搜索窗口中使用它来对其进行测试.

I think you just forgot to replace the 'a' tag with the 'script' tag in your xpath expression. I can't verify in code at the moment but you can use chrome dev tools to test these by going to expect and using it in the search window.

我将其修改为具有script标签,并且使用chrome dev工具为我工作.这是我在页面上尝试过的xpath:

I modified it to have the script tag instead and it worked for me using the chrome dev tools. This is the xpath I tried on the page:

//script[contains(.,'window.__PRELOADED_STATE__')]