2

I need to execute some javascript before the page page loads(= before the javascript on the page is executed)

Is that possible via ghostdriver? using phantomjsdriver 1.2.1 for java, phantomjs 2.0

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
int lawl is over 9000
  • 977
  • 1
  • 15
  • 25

1 Answers1

2

No.

PhantomJS is effectively a browser. You cannot edit a webpage in a browser before the browser has loaded it.

Don't bother trying to disable JavaScript in PhatomJS either because then you won't be able to use JavaScript to inject the JavaScript you need before enabling JavaScript.

Ardesco
  • 7,281
  • 26
  • 49