gpt4 book ai didi

.net - Powershell 和 HtmlAgilityPack

转载 作者:行者123 更新时间:2023-12-02 23:48:01 25 4
gpt4 key购买 nike

我需要使用 Powershell 进行一些屏幕抓取并浏览了这篇文章

http://www.leeholmes.com/blog/2010/03/05/html-agility-pack-rocks-your-screen-scraping-world/

并希望快速启动并运行演示。但是,我马上遇到了障碍,不知道为什么会失败。

代码如下:

add-type -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"

马上,我收到以下错误:
PS C:\TEMP\HtmlAgilityPack\Net20> add-type -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"
Add-Type : Could not load file or assembly 'file:///C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
At line:1 char:9
+ add-type <<<< -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"
+ CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatException
+ FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand

最佳答案

你的问题是它默认运行在 2.0 运行时我相信这个 question告诉你如何解决。

关于.net - Powershell 和 HtmlAgilityPack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11649849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com