Code Monkey home page Code Monkey logo

koishi-plugin-puppeteer's Introduction

koishi-plugin-puppeteer

npm

浏览器 API 服务,可用于网页截图等。

注意:为了正常使用这个插件,你首先需要确保你的电脑上已经安装有 Chromium。同时,我们建议你保持 Chromium 和本插件的更新,因为版本不匹配可能会导致本插件无法正常使用。

类:Puppeteer

可以通过 ctx.puppeteer 访问。

puppeteer.launch()

  • 返回值: Promise<void>

启动并连接浏览器。

puppeteer.close()

  • 返回值: Promise<void>

关闭浏览器并取消连接。

puppeteer.page()

  • 返回值: Promise<Page>

创建一个新页面。

puppeteer.render(content, callback?)

  • content: string 要渲染的 HTML
  • callback: (page, next) => Promise<string> 回调函数
    • page: Page 页面实例
    • next: (handle: ElementHandle) => Promise<string> 渲染函数
  • 返回值: string

渲染一个 HTML 页面。

koishi-plugin-puppeteer's People

Contributors

shigma avatar lipraty avatar idranme avatar anillc avatar maxoyed avatar seidko avatar srk24 avatar h4m5ter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.