public class Puppeteer extends Object
| 构造器和说明 |
|---|
Puppeteer() |
Puppeteer(String projectRoot,
String preferredRevision,
boolean isPuppeteerCore,
String productName) |
| 限定符和类型 | 方法和说明 |
|---|---|
static Browser |
connect(BrowserOptions options,
String browserWSEndpoint,
String browserURL,
ConnectionTransport transport,
String product)
连接一个已经存在的浏览器实例
browserWSEndpoint、browserURL、transport有其中一个就行了
|
BrowserFetcher |
createBrowserFetcher() |
BrowserFetcher |
createBrowserFetcher(FetcherOptions options) |
List<String> |
defaultArgs(ChromeArgOptions options) |
String |
executablePath() |
String |
getPreferredRevision() |
String |
getProjectRoot() |
static Browser |
launch()
以默认参数启动浏览器
launch Browser by default options
|
static Browser |
launch(boolean headless) |
static Browser |
launch(LaunchOptions options) |
void |
setPreferredRevision(String preferredRevision) |
void |
setProjectRoot(String projectRoot) |
public static Browser launch() throws IOException
IOException - 异常public static Browser launch(boolean headless) throws IOException
IOExceptionpublic static Browser launch(LaunchOptions options) throws IOException
IOExceptionpublic static Browser connect(BrowserOptions options, String browserWSEndpoint, String browserURL, ConnectionTransport transport, String product)
options - 连接的浏览器选项browserWSEndpoint - websocket http transport 三选一browserURL - websocket http transport 三选一transport - websocket http transport 三选一product - 谷歌还是火狐public List<String> defaultArgs(ChromeArgOptions options)
public String executablePath() throws IOException
IOExceptionpublic BrowserFetcher createBrowserFetcher()
public BrowserFetcher createBrowserFetcher(FetcherOptions options)
public String getProjectRoot()
public void setProjectRoot(String projectRoot)
public String getPreferredRevision()
public void setPreferredRevision(String preferredRevision)
Copyright © 2020. All rights reserved.