-
- 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 List<NavigateEntry>navigateHistoryprivate final BrowserTypebrowserTypeprivate final BooleansupportJavascriptprivate final BooleanisMockedPageSourceprivate final StringsessionIdprivate final WebDriverdriverprivate final Integerpriorityprivate final Browserbrowserprivate 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.protocol.browser.driver.WebDriverAdapter
allAttrs, allTexts, cancel, clickNthAnchor, compareTo, equals, evaluateSilently, firstAttr, firstText, free, hashCode, jvm, loadResource, navigateTo, newSession, outerHTML, retire, scrollDown, scrollToBottom, scrollToMiddle, scrollToTop, scrollUp, startWork, toString -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractWebDriver
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.AbstractJvmWebDriver
clickAsync, clickMatchesAsync, isHidden, stopLoading, visible -
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
List<NavigateEntry> getNavigateHistory()
-
getBrowserType
BrowserType getBrowserType()
-
getSupportJavascript
Boolean getSupportJavascript()
-
getIsMockedPageSource
Boolean getIsMockedPageSource()
-
getSessionId
String getSessionId()
-
getDriver
final WebDriver getDriver()
-
getPriority
final Integer getPriority()
-
getBrowser
Browser getBrowser()
-
getDelayPolicy
Function1<String, Long> getDelayPolicy()
-
getIsCanceled
Boolean getIsCanceled()
-
getIsCrashed
Boolean getIsCrashed()
-
getIsReady
Boolean getIsReady()
-
getIsRecovered
Boolean getIsRecovered()
-
setIsRecovered
Unit setIsRecovered(Boolean isRecovered)
-
getIsRetired
Boolean getIsRetired()
-
getIsReused
Boolean getIsReused()
-
setIsReused
Unit setIsReused(Boolean isReused)
-
getIsWorking
Boolean getIsWorking()
-
getLastActiveTime
Instant getLastActiveTime()
-
setLastActiveTime
Unit setLastActiveTime(Instant lastActiveTime)
-
getMainRequestCookies
List<Map<String, String>> getMainRequestCookies()
-
getMainRequestHeaders
Map<String, Object> getMainRequestHeaders()
-
getMainResponseHeaders
Map<String, Object> getMainResponseHeaders()
-
getMainResponseStatus
Integer getMainResponseStatus()
-
getMainResponseStatusText
String getMainResponseStatusText()
-
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()
The actual url return by the browser
-
pageSource
String pageSource()
The real time page source return by the browser
-
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)
-
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
Map<String, Object> mainRequestHeaders()
-
mainRequestCookies
List<Map<String, String>> mainRequestCookies()
-
getCookies
List<Map<String, String>> getCookies()
-
bringToFront
Unit bringToFront()
-
captureScreenshot
String captureScreenshot(String selector)
-
captureScreenshot
String captureScreenshot(RectD rect)
-
setTimeouts
Unit setTimeouts(BrowserSettings browserSettings)
-
awaitTermination
Unit awaitTermination()
-
-
-
-