Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PhantomJS

 PhantomJS

Explaining PhantomJS and why it's useful to web developers.

Arthur Kay

June 01, 2012
Tweet

More Decks by Arthur Kay

Other Decks in Technology

Transcript

  1. Who am I? !   Arthur Kay !   Solutions

    Engineer at Sencha, Inc. !   Longtime ExtJS fanatic !   Web developer for 10+ years !   www.akawebdesign.com !   @arthurakay !   Want a cool job? Sencha is hiring!
  2. Sencha Chicago User Group !   Looking for: !  

    Speakers !   Ideas !   Giveaways !   Sponsors !   GET INVOLVED!
  3. Don’t be scared! !   Headless WebKit browser (FAST!!!) !

      JavaScript API (also CoffeeScript) !   Ideal for unit tests, site scraping, SVG rendering, network monitoring, etc. ! www.PhantomJS.org
  4. API !   phantom !   exit(val) ! injectJs(file) !

    WebPage !   evaluate(function() { … }) !   open(url, callback) !   render(filename) ! sendEvent(type, x, y) ! Filesystem !   list(path) ! isFile(path)
  5. Examples !   Hello, World! !   Passing arguments !

      Render images (screenshots) !   Webpage load speed ! PhantomLint !   Jasmine
  6. Let’s Hack! !   Ideas: !   Website/server uptime monitoring

    tool !   Crawl filesystem for HTML files and snapshot !   Simulate mouse move/click on webpage (integration test!)