Sign inSign up

0132621641/node-js-app

By 0132621641

•Updated 5 months ago

capture a website and return the base64-encoded string

Image
Integration & delivery
0

1.2K

0132621641/node-js-app repository overview

capture a website and return the base64-encoded string

⁠let say you run this on port 3333

docker run -d -p 3333:3000 --name selenium 0132621641/node-js-app:latest

⁠send POST request to get the base64-encoded string of a URL

curl localhost:3333/page/screenshot -X POST -H 'Content-Type:application/json' -d '{"url":"https://www.google.com"}'

⁠then you need to transform the base64-encoded string into Buffer

fs.writeFileSync('/tmp/image.png', Buffer.from( stdOut, 'base64' ));

Tag summary

Content type

Image

Digest

sha256:5b4dac210…

Size

751.2 MB

Last updated

5 months ago

docker pull 0132621641/node-js-app