Window object in PhantomJS

心已入冬 提交于 2019-12-11 03:29:33

问题


I have seen in some documentation of PhantomJS that it can access the global "document" object but I don't know if it is also possible to access the global "window" object.

So my question is, is there a special way or I can just call the window object directly after I initialize a page using PhantomJS?


回答1:


Running phantomjs from a terminal gives you an interactive session you can play around with.

If you then run console.log(window) you'll see you have access to the window object.

phantomjs> console.log(window);
[object DOMWindow]


来源:https://stackoverflow.com/questions/15437565/window-object-in-phantomjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!