前端就有了對 headless 瀏覽器的需求,最多的應用場景有兩個javascript
也就有了不少傑出的實現,前端常用的莫過於 PhantomJS 和 selenium-webdriver,但兩個庫有一個共性——難用!環境安裝複雜,API 調用不友好,1027 年 Chrome 團隊連續放了兩個大招 Headless Chrome 和對應的 NodeJS API Puppeteer,直接讓 PhantomJS 和 Selenium IDE for Firefox 做者宣佈不必繼續維護其產品.html
如同其 github 項目介紹:Puppeteer 是一個經過 DevTools Protocol 控制 headless chrome 的 high-level Node 庫,也能夠經過設置使用 非 headless Chrome前端
咱們手工能夠在瀏覽器上作的事情 Puppeteer 都能勝任java
PuppeteerSharpgit
Puppeteer Sharp是官方Node.JS Puppeteer API的.NET 移植github
這個項目很活躍,你們能夠經過做者博客上獲取更新記錄 http://www.hardkoded.com/web
博客園裏有一篇文章 PuppeteerSharp+AngleSharp的爬蟲實戰之汽車之家數據抓取:https://www.cnblogs.com/VAllen/p/PuppeteerSharp-AngleSharp-CrawlerSamples.html 更詳細的介紹瞭如何使用PuppeterSharp。在github上還有一個PuppeterSharp的擴展項目:https://github.com/hlaueriksson/puppeteer-sharp-contrib chrome
相關文章:docker