fcavallarin / htcap

htcap is a web application scanner able to crawl single page application (SPA) recursively by intercepting ajax calls and DOM changes.
GNU General Public License v2.0
610 stars 114 forks source link

Update crawler.py #2

Closed iambrosie closed 8 years ago

iambrosie commented 8 years ago

Modified get_phantomjs_cmd to use from distutils import spawn followed by spawn.find_executable(). I believe it is more pythonic and also more general as it works without hardcoded folders. It is cross-platform (tested on linux with python 2.7.9 and on windows with python 2.7.6). Tested with non-existend executable - returns None. Tested with executable in current directory and it works as expected - return ['phantomjs', '--ignore-ssl-errors=yes', '--web-security=false', '--ssl-protocol=any', '--debug=false']. Tested with executable in /usr/local/bin and returns ['/usr/local/bin/phantomjs', '--ignore-ssl-errors=yes', '--web-security=false', '--ssl-protocol=any', '--debug=false'].