ukwa/webrender-puppeteer

By ukwa

Updated about 4 years ago

Web page rendering utility based on Google's Puppeteer

Image
Languages & frameworks
Integration & delivery
Web analytics
0

10K+

ukwa/webrender-puppeteer repository overview

webrender-puppeteer

Like https://github.com/ukwa/webrender-phantomjs but backed by Google Puppeteer.

Note that npm can be used to control versioning in package.json and tagging. e.g. npm version major for a major version bump. Instead of major this can be minor or patch, i.e. SemVer.

Then a `git push origin master --follow-tags`` should build a suitably tagged release.

To Do

  • Check 204 status, throw error if it didn't work
  • warcprox_prefix parameter and passing that through as an extra header, as per
    • extra_headers = { "Warcprox-Meta" : json.dumps( { 'warc-prefix' : warc_prefix}) }
  • har
  • imagemap
  • thumbnail?
  • Tests: simple page, dynamic page, serviceworker, pdf, xml, dead/gone site, unicode URLs
  • features (ENV or URL?): USER_AGENT_ADDITIONAL, switchDevices, scaleFactor, viewport width/height, memento datetime,

def build_imagemap(page_jpeg, page): html = "%s [Static version of %s]\n\n<body style="margin: 0;">\n" % (page['title'], page['url']) html = html + '%s\n' %( base64.b64encode(page_jpeg).decode('utf-8'), page['title']) html = html + '\n' for box in page['map']: if 'href' in box: x1 = box['location']['left'] y1 = box['location']['top'] x2 = x1 + box['location']['width'] y2 = y1 + box['location']['height'] html = html + '\n' % (x1,y1,x2,y2,box['href']) else: logger.debug("Skipping box with no 'href': %s" % box) html = html + '\n' html = html + "\n\n" return html

Tag summary

Content type

Image

Digest

Size

437.4 MB

Last updated

about 4 years ago

docker pull ukwa/webrender-puppeteer