Headless browser in Azure functions JavaScript?

半世苍凉 提交于 2019-12-24 20:32:49

问题


I tried using phantomjs but apparently it's unsupported, is there any way to scrape websites using azure functions in javascript?


回答1:


There are many restrictions on Azure App Service (includes WebApps, Function Apps), such as Win32k.sys (User32/GDI32) Restrictions. So some packages are not supported on Azure App Service, which like PhantomJS/puppteer be required to start a headless browser which needs GDI support to communicate with javascript/nodejs to get DOM node.

You can scrape a static web page or only HTML via Node http.ClientRequest or Request package in Function App. If to scrape a DOM node of a web page dynamically, the only way is using PhantomJS/puppteer on Azure VM, not Function Apps.



来源:https://stackoverflow.com/questions/53708299/headless-browser-in-azure-functions-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!