Sh.Common.Puppeteer 1.0.0

dotnet add package Sh.Common.Puppeteer --version 1.0.0
                    
NuGet\Install-Package Sh.Common.Puppeteer -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sh.Common.Puppeteer" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sh.Common.Puppeteer" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Sh.Common.Puppeteer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sh.Common.Puppeteer --version 1.0.0
                    
#r "nuget: Sh.Common.Puppeteer, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Sh.Common.Puppeteer&version=1.0.0
                    
Install Sh.Common.Puppeteer as a Cake Addin
#tool nuget:?package=Sh.Common.Puppeteer&version=1.0.0
                    
Install Sh.Common.Puppeteer as a Cake Tool

Puppeteer

对于工具开人员怎么用他就是什么.好东西 ,好好用用.

官方地址:

在这里 只是让他正常的运行及 环境本地化.茹果你要是有情趣研究其内部的 信息可以阅读一下,文档来完善.筑基的功能. 我感觉 导出PDF 及打印很很重要. 在我们日常开发中用的很多.胆汁这里么有打印功能

<span style=" color:red"> 注 首次运行是需要很长时间 。因为他 正在下载需要的chrome 你也可以在项目运行牡蛎中 将下载的 chrome 放在 PuppeteerDownload 中 格式:D:\Project\NuGet\SH\Sh.Common.Puppeteer.UnitTest\bin\Debug\netcoreapp3.1\PuppeteerDownload\Win64-706915\chrome-win

   [Fact]
    public void Test_ScreenShots()
    {
        File.Delete("D://ScreenShots.jpg");
        Helper helper = Helper.Init().Result;
        helper.ScreenShotsAsync("https://www.puppeteersharp.com/api/PuppeteerSharp.LaunchOptions.html", "D://ScreenShots.jpg").Wait();
        Assert.True(File.Exists("D://ScreenShots.jpg"));
    }
    [Fact]
    public void Test_GetPageInfoUrls()
    {
        Helper helper = Helper.Init().Result;
        var urls = helper.GetPageInfoUrlsAsync("http://www.baidu.com");
        Assert.NotNull(urls.Result);
    }


    [Fact]
    public void Test_PageToPDF()
    {
        File.Delete("D://Pdf1.pdf");
        Helper helper = Helper.Init().Result;
        helper.ToPdfAsync("https://www.baidu.com", "D://Pdf1.pdf").Wait();
        Assert.True(File.Exists("D://Pdf1.pdf"));
    }
还有个两个方法:
* GetBrowser(LaunchOptions launchOptions = null)
* public async Task<Page> GetPage(LaunchOptions launchOptions = null)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 565 5/3/2020

个人用到将持续更新,