matthewmueller / x-ray

The next web scraper. See through the <html> noise.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

X-Ray-Phantom Incompatibile SockJS Error

bassemAmous opened this issue · comments

Subject of the issue

Describe your issue here.

Your environment

  • version of node: run node --version
  • version of npm: run npm --version

Steps to reproduce

Tell us how to reproduce this issue.

Expected behaviour

Tell us what should happen.

Actual behaviour

Tell us what happens instead.

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();
})

resolved by adding

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

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