In the latest version of ReactJS I can not execute code in the JS console ga.getAll(); . I execute code inside PhantomJS.

 driver = Selenium::WebDriver.for :phantomjs driver.get 'https://www.vezetvsem.ru/booking' driver.execute_script 'return ga.getAll();' 

An error is returned instead of the object:

 undefined is not a constructor (evaluating 'ga.getAll()') 

The same code works great in Chrome or in an older version of ReactJS.

Any idea how to solve this problem?

  • Perhaps the page at that time is still being formed, and we must wait for the appearance of some characteristic element? - D-side
  • Most likely - it is not. The fact is that until the page completely loads, the code will not go to the line driver.execute_script . Moreover, simply returning the version of ReactJS to a higher version - everything works. - TIT

0