Skip to content

Instantly share code, notes, and snippets.

@ii0
Forked from Breefield/phantom.js
Created August 22, 2016 06:29

Revisions

  1. Dustin Hoffman created this gist Sep 9, 2012.
    7 changes: 7 additions & 0 deletions phantom.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    var page = require('webpage').create();

    // User-Agent is supported through page.settings
    page.settings.userAgent = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25';

    // This is how you set other header variables
    page.customHeaders = {'Referer': 'localhost'};