-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.config.Parameterized,java.lang.AutoCloseable
public class BrowserEmulator extends BrowserEmulatorBase
Created by vincent on 18-1-1. Copyright @ 2013-2017 Platon AI. All rights reserved.
-
-
Field Summary
Fields Modifier and Type Field Description private final MeternumDeferredNavigatesprivate SuspendFunction2<InteractTask, InteractResult, Unit>scrollDownPolicyprivate final WebDriverPoolManagerdriverPoolManagerprivate final BooleansupportAllCharsetsprivate final PatterncharsetPatternprivate final AtomicBooleanclosedprivate final BooleanisActiveprivate final MetermeterNavigatesprivate final CountercounterRequestsprivate final CountercounterJsEvaluatesprivate final CountercounterJsWaitsprivate final CountercounterCancelsprivate final WebDriverSettingsdriverSettingsprivate final BrowserResponseHandlerresponseHandlerprivate final ImmutableConfigimmutableConfig
-
Constructor Summary
Constructors Constructor Description BrowserEmulator(WebDriverPoolManager driverPoolManager, BrowserResponseHandler responseHandler, ImmutableConfig immutableConfig)
-
Method Summary
-
Methods inherited from class ai.platon.pulsar.protocol.browser.emulator.BrowserEmulator
close, createResponse, createResponseWithDatum, getParams, logBeforeNavigate -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BrowserEmulator
BrowserEmulator(WebDriverPoolManager driverPoolManager, BrowserResponseHandler responseHandler, ImmutableConfig immutableConfig)
-
-
Method Detail
-
getNumDeferredNavigates
final Meter getNumDeferredNavigates()
-
getScrollDownPolicy
final SuspendFunction2<InteractTask, InteractResult, Unit> getScrollDownPolicy()
-
setScrollDownPolicy
final Unit setScrollDownPolicy(SuspendFunction2<InteractTask, InteractResult, Unit> scrollDownPolicy)
-
getDriverPoolManager
final WebDriverPoolManager getDriverPoolManager()
-
getSupportAllCharsets
final Boolean getSupportAllCharsets()
-
getCharsetPattern
final Pattern getCharsetPattern()
-
getClosed
final AtomicBoolean getClosed()
-
getIsActive
final Boolean getIsActive()
-
getMeterNavigates
final Meter getMeterNavigates()
-
getCounterRequests
final Counter getCounterRequests()
-
getCounterJsEvaluates
final Counter getCounterJsEvaluates()
-
getCounterJsWaits
final Counter getCounterJsWaits()
-
getCounterCancels
final Counter getCounterCancels()
-
getDriverSettings
final WebDriverSettings getDriverSettings()
-
getResponseHandler
final BrowserResponseHandler getResponseHandler()
Handle the response
-
getImmutableConfig
final ImmutableConfig getImmutableConfig()
-
fetch
FetchResult fetch(FetchTask task, WebDriver driver)
Fetch a page using a browser which can render the DOM and execute scripts.
- Parameters:
task- The task to fetch
-
jsScrollDown
Unit jsScrollDown(InteractTask interactTask, InteractResult result)
-
-
-
-