-
- All Implemented Interfaces:
-
ai.platon.pulsar.crawl.fetch.driver.WebDriver,java.io.Closeable,java.lang.AutoCloseable,kotlin.Comparable
public final class ChromeDevtoolsDriver extends AbstractWebDriver
-
-
Field Summary
Fields Modifier and Type Field Description private final BrowserTypebrowserTypeprivate final IntegeropenSequenceprivate final BooleanenableUrlBlockingprivate final List<String>blockedURLsprivate InstantlastActiveTimeprivate final BooleanisGoneprivate final BooleanisActiveprivate final RemoteDevToolsimplementationprivate final StringsessionIdprivate final ChromeTabchromeTabprivate final RemoteDevToolsdevToolsprivate final BrowserSettingsbrowserSettingsprivate final ChromeDevtoolsBrowserbrowserprivate final Function1<String, Long>delayPolicyprivate final Integeridprivate DurationidleTimeoutprivate final BooleanisCanceledprivate final BooleanisCrashedprivate final BooleanisFreeprivate final BooleanisIdleprivate final BooleanisMockedPageSourceprivate final BooleanisQuitprivate BooleanisRecoveredprivate final BooleanisRetiredprivate final BooleanisWorkingprivate final Stringnameprivate NavigateEntrynavigateEntryprivate final List<NavigateEntry>navigateHistoryprivate final AtomicReference<WebDriver.Status>statusprivate final BooleansupportJavascriptprivate DurationwaitForTimeout
-
Constructor Summary
Constructors Constructor Description ChromeDevtoolsDriver(ChromeTab chromeTab, RemoteDevTools devTools, BrowserSettings browserSettings, ChromeDevtoolsBrowser browser)
-
Method Summary
-
Methods inherited from class ai.platon.pulsar.protocol.browser.driver.cdt.ChromeDevtoolsDriver
allAttrs, allTexts, cancel, check, clickMatches, clickMatches, clickNthAnchor, compareTo, equals, evaluateSilently, firstAttr, firstText, free, hashCode, isChecked, loadResource, navigateTo, newSession, outerHTML, quit, retire, scrollDown, scrollToBottom, scrollToMiddle, scrollToTop, scrollUp, startWork, uncheck, waitForNavigation, waitForNavigation, waitForSelector, waitForSelector -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractWebDriver
isHidden, stopLoading, visible -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ChromeDevtoolsDriver
ChromeDevtoolsDriver(ChromeTab chromeTab, RemoteDevTools devTools, BrowserSettings browserSettings, ChromeDevtoolsBrowser browser)
-
-
Method Detail
-
getBrowserType
BrowserType getBrowserType()
-
getOpenSequence
final Integer getOpenSequence()
-
getEnableUrlBlocking
final Boolean getEnableUrlBlocking()
-
getBlockedURLs
final List<String> getBlockedURLs()
-
getLastActiveTime
Instant getLastActiveTime()
-
setLastActiveTime
Unit setLastActiveTime(Instant lastActiveTime)
-
getIsActive
final Boolean getIsActive()
-
getImplementation
final RemoteDevTools getImplementation()
-
getSessionId
String getSessionId()
-
getChromeTab
final ChromeTab getChromeTab()
-
getDevTools
final RemoteDevTools getDevTools()
-
getBrowserSettings
final BrowserSettings getBrowserSettings()
-
getBrowser
ChromeDevtoolsBrowser getBrowser()
-
getDelayPolicy
Function1<String, Long> getDelayPolicy()
-
getIdleTimeout
Duration getIdleTimeout()
-
setIdleTimeout
Unit setIdleTimeout(Duration idleTimeout)
-
getIsCanceled
Boolean getIsCanceled()
-
getIsCrashed
Boolean getIsCrashed()
-
getIsMockedPageSource
Boolean getIsMockedPageSource()
-
getIsRecovered
Boolean getIsRecovered()
-
setIsRecovered
Unit setIsRecovered(Boolean isRecovered)
-
getIsRetired
Boolean getIsRetired()
-
getIsWorking
Boolean getIsWorking()
-
getNavigateEntry
NavigateEntry getNavigateEntry()
-
setNavigateEntry
Unit setNavigateEntry(NavigateEntry navigateEntry)
-
getNavigateHistory
List<NavigateEntry> getNavigateHistory()
-
getStatus
AtomicReference<WebDriver.Status> getStatus()
-
getSupportJavascript
Boolean getSupportJavascript()
-
getWaitForTimeout
Duration getWaitForTimeout()
-
setWaitForTimeout
Unit setWaitForTimeout(Duration waitForTimeout)
-
addInitScript
Unit addInitScript(String script)
-
addBlockedURLs
Unit addBlockedURLs(List<String> urls)
-
setTimeouts
Unit setTimeouts(BrowserSettings browserSettings)
-
navigateTo
Unit navigateTo(NavigateEntry entry)
-
mainRequestHeaders
Map<String, Object> mainRequestHeaders()
-
mainRequestCookies
List<Map<String, String>> mainRequestCookies()
-
getCookies
List<Map<String, String>> getCookies()
-
currentUrl
String currentUrl()
-
waitForSelector
Long waitForSelector(String selector, Duration timeout)
-
waitForNavigation
Long waitForNavigation(Duration timeout)
-
moveMouseTo
Unit moveMouseTo(Double x, Double y)
-
click
Unit click(String selector, Integer count)
This method fetches an element with
selector, scrolls it into view if needed, and then uses {@link Mouse} to click in the center of the element. If there's no element matchingselector, the method do not click anything.- Parameters:
selector-A
selectorto search for element to click. If there are multiple elements satisfying theselector, the first will be clicked
count-Click count
-
dragAndDrop
Unit dragAndDrop(String selector, Integer deltaX, Integer deltaY)
-
clickablePoint
PointD clickablePoint(String selector)
-
boundingBox
RectD boundingBox(String selector)
-
captureScreenshot
String captureScreenshot(String selector)
This method scrolls element into view if needed, and then uses {@link page.captureScreenshot} to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
-
captureScreenshot
String captureScreenshot(RectD clip)
-
pageSource
String pageSource()
-
bringToFront
Unit bringToFront()
-
awaitTermination
Unit awaitTermination()
-
-
-
-