Skip to main content

Render JavaScript-rendered page as HTML using headless Chrome

Project description

# prerender

Render JavaScript-rendered page as HTML/PDF/mhtml/png/jpeg using headless Chrome

## Install Chrome

Headless mode is supported in Chrome unstable/dev channel, you should be able to install it via:

https://www.google.com/chrome/browser/beta.html?platform=linux

## Start Chrome Headless

`bash $ google-chrome-unstable --headless --remote-debugging-port=9222 --disable-gpu "about:blank" `

## Install Prerender

`bash $ pip install -U prerender `

## Start Prerender

As standalone application:

`bash $ prerender `

To run it under gunicorn:

`bash $ gunicorn --bind 0.0.0.0:3000 --worker-class sanic.worker.GunicornWorker prerender.app:app `

## How does it work

Say you deployed Prerender under http://prerender.example.com:8000, to render http://example.com you can do:

`bash $ # render HTML $ curl http://prerender.example.com:8000/http://example.com $ curl http://prerender.example.com:8000/html/http://example.com $ # render mhtml $ curl http://prerender.example.com:8000/mhtml/http://example.com $ # render PDF $ curl http://prerender.example.com:8000/pdf/http://example.com $ # render png $ curl http://prerender.example.com:8000/png/http://example.com $ # render jpeg $ curl http://prerender.example.com:8000/jpeg/http://example.com `

## Configure client

Please view the original NodeJs version [prerender](https://github.com/prerender/prerender#official-middleware) README.

## License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prerender-0.7.3.dev5.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

prerender-0.7.3.dev5-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file prerender-0.7.3.dev5.tar.gz.

File metadata

File hashes

Hashes for prerender-0.7.3.dev5.tar.gz
Algorithm Hash digest
SHA256 2f380b53dace7049b26f41c8479b1241b0575302f0e4e0f45c873c28b48028f3
MD5 ee4739c79a889967205465bce379fb08
BLAKE2b-256 8cc849b52e63d38554bcc999cf64ca0e20725aa5abe63d0871d3ddadbfa91144

See more details on using hashes here.

File details

Details for the file prerender-0.7.3.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for prerender-0.7.3.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 256b5692869d51834f08f8f8bc2a40d0699955420f63198536d9497f5b25f4a1
MD5 fa86034c2bbc11c56f02bb35ebfea5e0
BLAKE2b-256 59bb81772c184fa32138a684d082b275a47f93ca18d7c4c7848742bef949d9ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page