Skip to content

Instantly share code, notes, and snippets.

@danquack
Created January 27, 2019 23:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save danquack/ae50ae16b37d5c97e6d434387b807bbd to your computer and use it in GitHub Desktop.
Example implementation of capturing traffic
# Example usage of https://github.com/danquack/Sitemap-Prerendering-S3
from os import environ
from prerender.prerender import Prerender
client = Prerender(robots_url="https://tournamentmgr.com/robots.txt",
s3_bucket=environ['s3_bucket'],
auth=(environ.get('username', None), environ.get('password', None)),
query_char_deliminator=' ',
allowed_domains=['tournamentmgr.com', 'amazonaws.com'])
# Entire page
client.capture()
# individual page
client.capture_page_and_upload("https://tournamentmgr.com/home")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment