| 程序包 | 说明 |
|---|---|
| com.ruiyun.jvppeteer.core.page |
| 限定符和类型 | 类和说明 |
|---|---|
class |
ElementHandle
ElementHandle represents an in-page DOM element.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static JSHandle |
JSHandle.createJSHandle(ExecutionContext context,
RemoteObject remoteObject) |
JSHandle |
Page.evaluateHandle(String pageFunction,
Object... args)
此方法是
Page.evaluateHandle(String, PageEvaluateType, Object...)的简化版,自动判断参数pageFunction是 Javascript 函数还是 Javascript 的字符串 |
JSHandle |
Page.evaluateHandle(String pageFunction,
PageEvaluateType type,
Object... args)
此方法和 page.evaluate 的唯一区别是此方法返回的是页内类型(JSHandle)
|
JSHandle |
Frame.evaluateHandle(String pageFunction,
PageEvaluateType type,
Object... args) |
JSHandle |
DOMWorld.evaluateHandle(String pageFunction,
PageEvaluateType type,
Object... args) |
JSHandle |
WaitTask.getPromise() |
JSHandle |
JSHandle.getProperty(String propertyName) |
JSHandle |
Worker.jsHandleFactory(RemoteObject remoteObject) |
JSHandle |
Page.queryObjects(JSHandle prototypeHandle)
此方法遍历js堆栈,找到所有带有指定原型的对象
|
JSHandle |
ExecutionContext.queryObjects(JSHandle prototypeHandle) |
JSHandle |
Page.waitFor(String selectorOrFunctionOrTimeout)
此方法根据第一个参数的不同有不同的结果:
如果 selectorOrFunctionOrTimeout 是 string, 那么认为是 css 选择器或者一个xpath, 根据是不是'//'开头, 这时候此方法是 page.waitForSelector 或 page.waitForXPath的简写
如果 selectorOrFunctionOrTimeout 是 function, 那么认为是一个predicate,这时候此方法是page.waitForFunction()的简写
如果 selectorOrFunctionOrTimeout 是 number, 那么认为是超时时间,单位是毫秒,返回的是Promise对象,在指定时间后resolve
否则会报错
|
JSHandle |
Page.waitFor(String selectorOrFunctionOrTimeout,
WaitForSelectorOptions options,
Object... args)
此方法根据第一个参数的不同有不同的结果:
如果 selectorOrFunctionOrTimeout 是 string, 那么认为是 css 选择器或者一个xpath, 根据是不是'//'开头, 这时候此方法是 page.waitForSelector 或 page.waitForXPath的简写
如果 selectorOrFunctionOrTimeout 是 function, 那么认为是一个predicate,这时候此方法是page.waitForFunction()的简写
如果 selectorOrFunctionOrTimeout 是 number, 那么认为是超时时间,单位是毫秒,返回的是Promise对象,在指定时间后resolve
否则会报错
|
JSHandle |
Frame.waitFor(String selectorOrFunctionOrTimeout,
WaitForSelectorOptions options,
Object... args) |
JSHandle |
Page.waitForFunction(String pageFunction)
要在浏览器实例上下文执行方法
|
JSHandle |
DOMWorld.waitForFunction(String pageFunction,
PageEvaluateType type,
WaitForSelectorOptions options,
Object... args) |
JSHandle |
Frame.waitForFunction(String pageFunction,
PageEvaluateType type,
WaitForSelectorOptions options,
Object[] args) |
JSHandle |
Page.waitForXPath(String xpath)
等待指定的xpath匹配的元素出现在页面中,如果调用此方法时已经有匹配的元素,那么此方法立即返回。
|
JSHandle |
Page.waitForXPath(String xpath,
WaitForSelectorOptions options)
等待指定的xpath匹配的元素出现在页面中,如果调用此方法时已经有匹配的元素,那么此方法立即返回。
|
JSHandle |
Frame.waitForXPath(String xpath,
WaitForSelectorOptions options) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<JSHandle> |
ConsoleMessage.args() |
Map<String,JSHandle> |
JSHandle.getProperties() |
Map<String,JSHandle> |
ElementHandle.getProperties() |
| 限定符和类型 | 方法和说明 |
|---|---|
JSHandle |
Page.queryObjects(JSHandle prototypeHandle)
此方法遍历js堆栈,找到所有带有指定原型的对象
|
JSHandle |
ExecutionContext.queryObjects(JSHandle prototypeHandle) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
ConsoleAPI.call(String type,
List<JSHandle> handles,
StackTrace stackTrace) |
void |
ConsoleMessage.setArgs(List<JSHandle> args) |
| 构造器和说明 |
|---|
ConsoleMessage(String type,
String text,
List<JSHandle> args,
Location location) |
Copyright © 2020. All rights reserved.