Class WebDriverAdapter
-
- All Implemented Interfaces:
-
ai.platon.pulsar.crawl.fetch.driver.JvmWebDriver,ai.platon.pulsar.crawl.fetch.driver.WebDriver,java.io.Closeable,java.lang.AutoCloseable,kotlin.Comparable
public final class WebDriverAdapter extends AbstractWebDriver
-
-
Field Summary
Fields Modifier and Type Field Description private DurationidleTimeoutprivate DurationwaitForElementTimeoutprivate final AtomicReference<WebDriver.State>stateprivate NavigateEntrynavigateEntryprivate final NavigateHistorynavigateHistoryprivate final BrowserTypebrowserTypeprivate final BooleansupportJavascriptprivate final BooleanisMockedPageSourceprivate final StringsessionIdprivate final WebDriverdriverprivate final Integerpriorityprivate final Browserbrowserprivate final Map<String, Object>dataprivate final Function1<String, Long>delayPolicyprivate final Integeridprivate final BooleanisCanceledprivate final BooleanisCrashedprivate final BooleanisFreeprivate final BooleanisIdleprivate final BooleanisInitprivate final BooleanisQuitprivate final BooleanisReadyprivate BooleanisRecoveredprivate final BooleanisRetiredprivate BooleanisReusedprivate final BooleanisWorkingprivate InstantlastActiveTimeprivate final List<Map<String, String>>mainRequestCookiesprivate final Map<String, Object>mainRequestHeadersprivate final Map<String, Object>mainResponseHeadersprivate final IntegermainResponseStatusprivate final StringmainResponseStatusTextprivate final Stringname
-
Constructor Summary
Constructors Constructor Description WebDriverAdapter(WebDriver driver, Integer priority)
-
Method Summary
-
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractWebDriver
allAttrs, allTexts, cancel, clickNthAnchor, compareTo, equals, evaluateSilently, firstAttr, firstText, free, getBrowser, getData, getDelayPolicy, getId, getLastActiveTime, getMainRequestCookies, getMainRequestHeaders, getMainResponseHeaders, getMainResponseStatus, getMainResponseStatusText, getName, hashCode, isCanceled, isCrashed, isFree, isInit, isQuit, isReady, isRecovered, isRetired, isReused, isWorking, jvm, loadJsoupResource, loadResource, navigateTo, newJsoupSession, newSession, outerHTML, outerHTML, retire, scrollDown, scrollToBottom, scrollToMiddle, scrollToTop, scrollUp, setLastActiveTime, setRecovered, setReused, startWork, toString -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.WebDriver
isHidden, isIdle, stopLoading, visible -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractJvmWebDriver
addBlockedURLsAsync, addInitScriptAsync, allAttrsAsync, allTextsAsync, boundingBoxAsync, bringToFrontAsync, captureScreenshotAsync, captureScreenshotAsync, checkAsync, clickAsync, clickMatchesAsync, clickMatchesAsync, clickNthAnchorAsync, clickablePointAsync, currentUrlAsync, dragAndDropAsync, evaluateAsync, evaluateSilentlyAsync, existsAsync, firstAttrAsync, firstTextAsync, getCookiesAsync, isCheckedAsync, isHiddenAsync, isVisibleAsync, loadResourceAsync, mainRequestCookiesAsync, mainRequestHeadersAsync, mouseWheelDownAsync, mouseWheelUpAsync, moveMouseToAsync, navigateToAsync, navigateToAsync, newSessionAsync, outerHTMLAsync, pageSourceAsync, pauseAsync, scrollDownAsync, scrollToAsync, scrollToBottomAsync, scrollToMiddleAsync, scrollToTopAsync, scrollUpAsync, setTimeoutsAsync, stopAsync, terminateAsync, typeAsync, uncheckAsync, visibleAsync, waitForNavigationAsync, waitForNavigationAsync, waitForNavigationAsync, waitForSelectorAsync, waitForSelectorAsync, waitForSelectorAsync -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.JvmWebDriver
clickAsync, clickMatchesAsync -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
WebDriverAdapter
WebDriverAdapter(WebDriver driver, Integer priority)
-
-
Method Detail
-
getIdleTimeout
Duration getIdleTimeout()
-
setIdleTimeout
Unit setIdleTimeout(Duration idleTimeout)
-
getWaitForElementTimeout
Duration getWaitForElementTimeout()
-
setWaitForElementTimeout
Unit setWaitForElementTimeout(Duration waitForElementTimeout)
-
getState
AtomicReference<WebDriver.State> getState()
-
getNavigateEntry
NavigateEntry getNavigateEntry()
-
setNavigateEntry
Unit setNavigateEntry(NavigateEntry navigateEntry)
-
getNavigateHistory
NavigateHistory getNavigateHistory()
-
getBrowserType
BrowserType getBrowserType()
-
getSupportJavascript
Boolean getSupportJavascript()
-
isMockedPageSource
Boolean isMockedPageSource()
-
getSessionId
String getSessionId()
-
getDriver
final WebDriver getDriver()
-
getPriority
final Integer getPriority()
-
addInitScript
Unit addInitScript(String script)
-
addBlockedURLs
Unit addBlockedURLs(List<String> urls)
-
addProbabilityBlockedURLs
Unit addProbabilityBlockedURLs(List<String> urls)
-
navigateTo
Unit navigateTo(NavigateEntry entry)
-
currentUrl
String currentUrl()
-
pageSource
String pageSource()
-
waitForSelector
Long waitForSelector(String selector)
-
waitForSelector
Long waitForSelector(String selector, Long timeoutMillis)
-
waitForSelector
Long waitForSelector(String selector, Duration timeout)
-
waitForNavigation
Long waitForNavigation()
-
waitForNavigation
Long waitForNavigation(Long timeoutMillis)
-
waitForNavigation
Long waitForNavigation(Duration timeout)
-
waitForPage
WebDriver waitForPage(String url, Duration timeout)
-
clickTextMatches
Unit clickTextMatches(String selector, String pattern, Integer count)
-
clickMatches
@Deprecated(message = "Inappropriate name", replaceWith = @ReplaceWith(imports = {}, expression = "clickTextMatches(selector, pattern, count")) Unit clickMatches(String selector, String pattern, Integer count)
-
clickMatches
Unit clickMatches(String selector, String attrName, String pattern, Integer count)
-
mouseWheelDown
Unit mouseWheelDown(Integer count, Double deltaX, Double deltaY, Long delayMillis)
-
mouseWheelUp
Unit mouseWheelUp(Integer count, Double deltaX, Double deltaY, Long delayMillis)
-
moveMouseTo
Unit moveMouseTo(Double x, Double y)
-
moveMouseTo
Unit moveMouseTo(String selector, Integer deltaX, Integer deltaY)
-
dragAndDrop
Unit dragAndDrop(String selector, Integer deltaX, Integer deltaY)
-
clickablePoint
PointD clickablePoint(String selector)
-
boundingBox
RectD boundingBox(String selector)
-
evaluateDetail
JsEvaluation evaluateDetail(String expression)
-
mainRequestHeaders
@Deprecated(message = "Getter is available", replaceWith = @ReplaceWith(imports = {}, expression = "mainRequestHeaders")) Map<String, Object> mainRequestHeaders()
-
mainRequestCookies
@Deprecated(message = "Getter is available", replaceWith = @ReplaceWith(imports = {}, expression = "mainRequestCookies")) List<Map<String, String>> mainRequestCookies()
-
getCookies
List<Map<String, String>> getCookies()
-
clearBrowserCookies
Unit clearBrowserCookies()
-
deleteCookies
Unit deleteCookies(String name)
-
deleteCookies
Unit deleteCookies(String name, String url, String domain, String path)
-
bringToFront
Unit bringToFront()
-
captureScreenshot
String captureScreenshot(String selector)
-
captureScreenshot
String captureScreenshot(RectD rect)
-
stop
Unit stop()
-
pause
Unit pause()
-
terminate
Unit terminate()
-
setTimeouts
Unit setTimeouts(BrowserSettings browserSettings)
-
awaitTermination
Unit awaitTermination()
-
quit
Unit quit()
Quits this driver, close every associated window
-
close
Unit close()
-
-
-
-