public class JSHandle extends Object
| 构造器和说明 |
|---|
JSHandle(ExecutionContext context,
CDPSession client,
RemoteObject remoteObject) |
| 限定符和类型 | 方法和说明 |
|---|---|
ElementHandle |
asElement() |
static JSHandle |
createJSHandle(ExecutionContext context,
RemoteObject remoteObject) |
void |
dispose()
阻塞释放elementHandle
|
void |
dispose(boolean isBlock)
释放elementhandle
当在websocket信息回调中处理时需要isBlock=false
|
Object |
evaluate(String pageFunction,
PageEvaluateType type,
Object... args) |
Object |
evaluateHandle(String pageFunction,
PageEvaluateType type,
Object... args) |
ExecutionContext |
executionContext() |
protected ExecutionContext |
getContext() |
protected boolean |
getDisposed() |
Map<String,JSHandle> |
getProperties() |
JSHandle |
getProperty(String propertyName) |
protected RemoteObject |
getRemoteObject() |
Object |
jsonValue() |
protected void |
setContext(ExecutionContext context) |
protected void |
setDisposed(boolean disposed) |
String |
toString() |
public JSHandle(ExecutionContext context, CDPSession client, RemoteObject remoteObject)
public ExecutionContext executionContext()
public Object evaluate(String pageFunction, PageEvaluateType type, Object... args)
public Object evaluateHandle(String pageFunction, PageEvaluateType type, Object... args)
public JSHandle getProperty(String propertyName) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic Object jsonValue()
public ElementHandle asElement()
public void dispose()
public void dispose(boolean isBlock)
isBlock - 是否是异步public static JSHandle createJSHandle(ExecutionContext context, RemoteObject remoteObject)
protected ExecutionContext getContext()
protected void setContext(ExecutionContext context)
protected boolean getDisposed()
protected void setDisposed(boolean disposed)
protected RemoteObject getRemoteObject()
Copyright © 2020. All rights reserved.