meds
meds

Reputation: 22956

Headless browser in Azure functions JavaScript?

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

Upvotes: 1

Views: 851

Answers (1)

Peter Pan
Peter Pan

Reputation: 24148

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.

Upvotes: 2

Related Questions