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

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

Uploaded Source

Built Distribution

prerender-0.3.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prerender-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c1f454854c185e53a35442b744159b228f91daae68aacc8f42a5b4c116e4c63d
MD5 57c8e9c0b452cb1c285497470df9cf96
BLAKE2b-256 61d5432436693d9607a3ea60d221a455472aae51adb4135a7f27ad8ac7b7843c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prerender-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 720f5db1f664f507b845db61810967a621160798a8a12189437efc0bb20338d5
MD5 4bcd885c3c8b6d16393423bd8f4b85de
BLAKE2b-256 ecadb8500d897e3cf70cd6fff494c31f5bb1b5bba9b329c2205b549848886e0d

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