-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,java.lang.AutoCloseable
public interface Browser implements EventEmitter<BrowserEvents>, AutoCloseable
The Browser defines methods and events to manipulate a real browser.
-
-
Method Summary
Modifier and Type Method Description abstract WebDrivernewDriver()Create a new driver. abstract UnitonWillNavigate(NavigateEntry entry)Register event handler when a url is about to navigate. abstract Unitmaintain()Maintain the browser abstract BrowserIdgetId()The unique browser id abstract StringgetUserAgent()The user agent to override, do not override if it's null. abstract List<NavigateEntry>getNavigateHistory()The navigation history. abstract Map<String, WebDriver>getDrivers()The created drivers by this browser. abstract BooleangetIsIdle()Check if this browser is idle. -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.Browser
close, count, emit, emit, emit, emit, emit1, emit1, emit1, emit1, hasListeners, hasNormalListeners, hasSuspendListeners, listeners, listeners, normalListeners, normalListeners, off, off, off, off, off, off1, off1, off1, off1, off1, on, on, on, on, on1, on1, on1, on1, once, once, once, once1, once1, once1, suspendListeners, suspendListeners -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onWillNavigate
abstract Unit onWillNavigate(NavigateEntry entry)
Register event handler when a url is about to navigate.
-
getUserAgent
abstract String getUserAgent()
The user agent to override, do not override if it's null.
-
getNavigateHistory
abstract List<NavigateEntry> getNavigateHistory()
The navigation history.
Navigate history is small, so search is very fast for a list.
-
getDrivers
abstract Map<String, WebDriver> getDrivers()
The created drivers by this browser.
-
-
-
-