lapwinglabs / x-ray-phantom

phantom driver for x-ray.
112 stars 30 forks source link

The example code errors #26

Open yaquawa opened 6 years ago

yaquawa commented 6 years ago

I got this when I run the example code. (The version of my node.js is v8.5.0)

phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occurred in synchronous requests.

  phantomjs://code/shim.js:1815 in send

phantom stdout:   phantomjs://code/shim.js:1815 in _start
  phantomjs://code/shim.js:1842
TaylorAckley commented 6 years ago

Cosign, though im pretty sure this is on Phantom. Here is my code:

const x = Xray()
    .driver(phantom({
        XSSAuditingEnabled: true,
        loadImages: false,
        webSecurityEnabled: false
    }))
    .concurrency(3)
    .throttle(3, 500);
TaylorAckley commented 6 years ago

@yaquawa I forgot to check the closed issues.... see here for resolution:

(Note the webSecurity:false prop passed to the phantom constructor)

https://github.com/lapwinglabs/x-ray-phantom/issues/16

knandraina commented 6 years ago

@TaylorAckley Where did you put this code? Into a new file?

TaylorAckley commented 6 years ago

@knandraina In reference to what? Which code?

knandraina commented 6 years ago

@TaylorAckley Yes I should have been more accurate. I have the same error as above

phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occurred in synchronous requests. phantomjs://code/shim.js:1815 in send phantom stdout: phantomjs://code/shim.js:1815 in _start phantomjs://code/shim.js:1842

I would like to fix that mistake and I asked where I needed to put this code

const x = Xray() .driver(phantom({ XSSAuditingEnabled: true, loadImages: false, webSecurityEnabled: false })) .concurrency(3) .throttle(3, 500);

TaylorAckley commented 6 years ago

It would replace the XRay instantiation you already have.

I guess if you need an example you can use my partially completed program: https://github.com/TaylorAckley/SitemapScraper/blob/master/Scraper.js

ralphdas commented 6 years ago

Watch out for the exact wording here:

    .driver(phantom({
        XSSAuditingEnabled: true,
        loadImages: false,
        webSecurity: false
    }))  

it is webSecurity not webSecurityEnabled

kjr247 commented 5 years ago

I also get this issue.