-
- 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 DurationwaitForTimeoutprivate final AtomicReference<WebDriver.Status>statusprivate 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 BooleanisQuitprivate BooleanisRecoveredprivate final BooleanisRetiredprivate final BooleanisWorkingprivate InstantlastActiveTimeprivate 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)
-
getWaitForTimeout
Duration getWaitForTimeout()
-
setWaitForTimeout
Unit setWaitForTimeout(Duration waitForTimeout)
-
getStatus
AtomicReference<WebDriver.Status> getStatus()
-
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()
-
getIsRecovered
Boolean getIsRecovered()
-
setIsRecovered
Unit setIsRecovered(Boolean isRecovered)
-
getIsRetired
Boolean getIsRetired()
-
getIsWorking
Boolean getIsWorking()
-
getLastActiveTime
Instant getLastActiveTime()
-
setLastActiveTime
Unit setLastActiveTime(Instant lastActiveTime)
-
addInitScript
Unit addInitScript(String script)
-
addBlockedURLs
Unit addBlockedURLs(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)
-
clickMatches
Unit clickMatches(String selector, String pattern, Integer count)
-
moveMouseTo
Unit moveMouseTo(Double x, Double y)
-
dragAndDrop
Unit dragAndDrop(String selector, Integer deltaX, Integer deltaY)
-
clickablePoint
PointD clickablePoint(String selector)
-
boundingBox
RectD boundingBox(String selector)
-
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()
-
-
-
-