Thank you for reading my topic, I would be very grateful if anyone could suggest any other ways that I have to study in order to achieve below.
Using CasperJS or PhantomJS I need to disable all JavaScript that belongs to the pages I'm navigating to from execution, while I can still work on my own using casper.execute.
Does anyone know how I can do this?
- Is it possible to change HTTP headers or bodies using onResourceRequested or onResourceReceived? or cancel the request conditionally? or are they read-only?
- Can you modify the original HTML source code before offering it for parsing?
- I tried to hack window.stop () in casper.execute before, but this works inconsistently between pages.
- Is the Phantom WebServer module used for this kind of thing? Could / Should I route reqs / responses through this and change them as they go?
Thanks for any help - I appreciate that this is a strange use case.
source share