2

I use the netsniff.js like this:

phantomjs --ignore-ssl-errors=true --ssl-protocol=any netsniff.js http://thermex.ru/ > t.out

When netsniff is done, I open file t.out in my text editor and I see the JS bugs like this:

TypeError: 'undefined' is not a function (evaluating   '$('.bxslider').bxSlider({
    mode: 'fade',
    preloadImages: 'all',
    slideWidth: 697
})')

http://thermex.ru/:565
http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js:2
http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js:2
http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js:2
http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js:2

after this errors I see valid HAR data.

But I don't can parse this file, because him contains no valid JSON data (JS errors + valid JSON HAR data = no valid JSON data).

How can I receive the valid file from netsniff.js for this domain?

1 Answer 1

2

You can register to the page.onError, page.onConsoleMessage and phantom.onError events to prevent the default action (before page.open in netsniff.js):

page.onError = function(){};
page.onConsoleMessage= function(){};
phantom.onError = function(){};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.