- Getting Started with PhantomJS
- Aries Beltran
- 178字
- 2021-11-12 16:29:32
The phantom object
The phantom
object is your reference to PhantomJS within your scripts that allows you to access certain properties and provides functionality that affects the entire script (such as quitting the application as previously mentioned.) The phantom
object can be directly referenced anywhere in the script and does not need to be explicitly imported. You may also access it as a child of the global window
object.
The phantom
object allows access to relevant data, such as cookies and library paths. If we want to import or inject third-party JavaScript libraries, such as jQuery, we can do that using the phantom
object. We can also create a "catch all" event handler for errors using the onError
event of the phantom
object.
PhantomJS not only allows us to harness the power of JavaScript but also gives us a very useful API. Each day, more and more contributors are enhancing this API, giving us more options and easier ways to solve real problems. We will learn more about these APIs as we continue our journey learning about PhantomJS.
- 流量的秘密:Google Analytics網(wǎng)站分析與優(yōu)化技巧(第2版)
- Java面向?qū)ο筌浖_(kāi)發(fā)
- JavaScript+jQuery開(kāi)發(fā)實(shí)戰(zhàn)
- 數(shù)據(jù)結(jié)構(gòu)(Python語(yǔ)言描述)(第2版)
- Internet of Things with the Arduino Yún
- 嚴(yán)密系統(tǒng)設(shè)計(jì):方法、趨勢(shì)與挑戰(zhàn)
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- Mastering Linux Network Administration
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)(第二版)
- Java SE實(shí)踐教程
- Java程序設(shè)計(jì)與項(xiàng)目案例教程
- TypeScript 2.x By Example
- 硬件產(chǎn)品設(shè)計(jì)與開(kāi)發(fā):從原型到交付
- Node.js區(qū)塊鏈開(kāi)發(fā)
- Elasticsearch搜索引擎構(gòu)建入門與實(shí)戰(zhàn)