问题
I am currently using phantomjs to generate screenshots of web pages. Due to various issues including web fonts, and video tag support, I would like to try switching to headless chrome.
Has anyone had success running headless chrome in an azure web app? I cannot find a .net api, and assume I need to run node.js with puppeteer If I want a javascript api similar to phantomjs.
回答1:
Right now most of the big libraries are made for NodeJS. It's possible to run Chrome headless without it, but you'll need a library for your .NET API to effectively communicate with Chrome. If none exist, then the protocol itself is documented here, and you could build one for .NET.
If you're struggling to get Chrome running on Azure I have a service that offers Docker images, which could be as simple as a few commands to have up and running (located here). Other than that there's a few open-source options out there, but they have differing issues and uses-cases.
来源:https://stackoverflow.com/questions/47265315/running-headless-chrome-in-an-microsoft-azure-web-app