matthewmueller / x-ray

The next web scraper. See through the <html> noise.
MIT License
5.87k stars 349 forks source link

X-Ray-Phantom Incompatibile SockJS Error #301

Closed bassemAmous closed 6 years ago

bassemAmous commented 6 years ago

Subject of the issue

Describe your issue here.

Your environment

Steps to reproduce

Tell us how to reproduce this issue.

Expected behaviour

Tell us what should happen.

Actual behaviour

Tell us what happens instead.

bassemAmous commented 6 years ago

I am developing Node-Js application using X-Ray library X-Ray-Phantom as a driver and I am getting an error: phantom stdout: Incompatibile SockJS! Main site uses: "0.3.1.7.ga67f.dirty", the iframe: "0.3.4". here is my code:

var phantom = require('x-ray-phantom');
var Xray = require('x-ray');
var x = Xray()
    .driver(phantom());
x('http://google.com', 'title')(function(err, str) {
    assert.equal('Google', str);
    done();
})
bassemAmous commented 6 years ago

resolved by adding

x = Xray().driver(phantom({webSecurity:false}))

kjr247 commented 6 years ago

This is still an issue even when trying x = Xray().driver(phantom({webSecurity:false})).