Advertisement
metalx1000

PhantomJS Scrape Mug Shots

May 21st, 2019
777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var page = require('webpage').create();
  2. page.open('http://www2.colliersheriff.org/arrestsearch/', function() {
  3.   page.evaluate(function(){
  4.     var a = document.getElementById("btnAccept");
  5.     var e = document.createEvent('MouseEvents');
  6.     e.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  7.     a.dispatchEvent(e);
  8.     waitforload = true;
  9.   });
  10.  
  11.   setTimeout(function(){
  12.     page.evaluate(function(){
  13.       document.getElementById("txtLastName").value = "smith";
  14.       var a = document.getElementById("btnSearch");
  15.       var e = document.createEvent('MouseEvents');
  16.       e.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  17.       a.dispatchEvent(e);
  18.       waitforload = true;
  19.     });
  20.   },2000);
  21.  
  22.   setTimeout(function(){
  23.     page.render('mugs.png');
  24.     phantom.exit();
  25.   },10000);
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement