puppeteer常用API
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md
Puppeteer是一个node库,他提供了一组用来操纵Chrome的API(默认headless也就是无UI的chrome,也可以配置为有UI)
Puppeteer(中文翻译”木偶”) 是 Google Chrome 团队官方的无界面(无头或无脑Headless)Chrome 工具,它是一个 Node 库,提供了一个高级的 API 来控制 DevTools协议上的无头版 Chrome 。也可以配置为使用完整(非无头)的 Chrome。Chrome 素来在浏览器界稳执牛耳,因此,Chrome Headless 必将成为 web 应用自动化测试的行业标杆。使用 Puppeteer,相当于同时具有 Linux 和 Chrome 双端的操作能力,应用场景可谓非常之多。此仓库的建立,即是尝试各种折腾使用 GoogleChrome Puppeteer;以期在好玩的同时,学到更多有意思的操作。
作用和Selenium相似,但是不能跨平台,只能用在chrome做自动化测试
官网:
https://github.com/GoogleChrome/puppeteer
大纲:
Q: What is the difference between Puppeteer, Selenium / WebDriver, and PhantomJS?
Selenium / WebDriver is a well-established cross-browser API that is useful for testing cross-browser support.
Puppeteer works only with Chromium or Chrome. However, many teams only run unit tests with a single browser (e.g. PhantomJS). In non-testing use cases, Puppeteer provides a powerful but simple API because it's only targeting one browser that enables you to rapidly develop automation scripts.
Puppeteer bundles the latest versions of Chromium.
Q: Why is the Chrome team building Puppeteer?
The goals of the project are simple:
手机扫一扫
移动阅读更方便
你可能感兴趣的文章