Created
          October 23, 2013 06:14 
        
      - 
      
- 
        Save steppefox/7113351 to your computer and use it in GitHub Desktop. 
    Template file for PhantomJS parser script
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var getBaseUrl = function(){ | |
| return 'http://wednesdaywolf.com'; | |
| } | |
| var page = require('webpage').create(); | |
| var base_url = getBaseUrl(); | |
| var i = 0; | |
| var counter = 0; | |
| var main_links = []; | |
| var global_flag = true; | |
| function size(obj) { | |
| var size = 0, key; | |
| for (key in obj) { | |
| if (obj.hasOwnProperty(key)) size++; | |
| } | |
| return size; | |
| } | |
| var lets_start = function(){ | |
| page.open(base_url, function(status) { | |
| if (status !== 'success') { | |
| console.log('Unable to access network'); | |
| } else { | |
| var ua = page.evaluate(function () { | |
| var links_list = []; | |
| return links_list; | |
| }); | |
| console.log(ua); | |
| } | |
| phantom.exit(); | |
| }); | |
| } | |
| lets_start(); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment