Skip to main content

Render JavaScript-rendered page as HTML using headless Chrome

Project description

# prerender

Render JavaScript-rendered page as HTML using headless Chrome

Currently only the `window.prerenderReady` inspection is supported.

## Install Chrome Headless

Chrome Headless broweser can be easily installed using Docker:

`bash $ docker pull yukinying/chrome-headless `

## Start Chrome Headless

`bash $ docker run -i -t --shm-size=256m --rm --name=chrome-headless -p=127.0.0.1:9222:9222 yukinying/chrome-headless "about:blank" `

Or you can download a Headless Chrome binary for Ubuntu 16.04 from GitHub release and run it:

`bash $ wget https://github.com/bosondata/prerender/releases/download/v0.3.0/ChromeHeadless.ubuntu-16.04-x86_64.tar.gz $ tar zxvf ChromeHeadless.ubuntu-16.04-x86_64.tar.gz $ cd ChromeHeadless $ ./headless_shell --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, first install some dependencies:

`bash $ pip install sanic-gunicorn `

Then:

`bash $ gunicorn --bind 0.0.0.0:3000 --worker-class sanic_gunicorn.Worker prerender.app:app `

## 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.4.7.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

prerender-0.4.7-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file prerender-0.4.7.tar.gz.

File metadata

  • Download URL: prerender-0.4.7.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for prerender-0.4.7.tar.gz
Algorithm Hash digest
SHA256 3e7dbf6aa22b2ff1a9371eb83e421d88cb068589b7b88b3de98c8d95d6563075
MD5 7f15585efc2a50476effac87d18fe1c5
BLAKE2b-256 8cdffed0a7d51a5ab8e0ef17ad0fcc22d5f022a1194d4391513feb05cc76fe0e

See more details on using hashes here.

File details

Details for the file prerender-0.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for prerender-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 04c738e29f93b90d4f1ce8c3c5f69889addcde7a6609b41831d9b2c8de332ba9
MD5 4441c112ad4a86348c6715c3d138b2e7
BLAKE2b-256 8b42f127c384c8870b99e32c9b89d19f0d376c7e084211baabbd1cbd781ef9bf

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