A
A
Aitalina2014-05-09 11:23:38
linux
Aitalina, 2014-05-09 11:23:38

How to edit incoming HTTP traffic, linux?

Hello.
Wrote a small Javascript parser under Phantomjs. Works exactly as it should, but there is a small problem. Randomly, on some pages, an HTML code appears, which, when the page is loaded, launches a JS code, and on this JS code, Phantomjs starts loading the percentage by 100% and is very slow. In this case, the onLoad event is not called.
I have already tried everything to cut out an objectionable piece of code from the page using Phantomjs before freezing, but nothing worked. In this regard, the idea came up to intercept all incoming packets, edit their contents if necessary, and pass them on to Phfntomjs. How can this be done? The traffic is compressed with gzip.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2014-05-09
@Nc_Soft

If objectionable js is loaded in a file, then you can not load it
https://github.com/ariya/phantomjs/blob/master/exa...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question