Class PulsarSettings

  • All Implemented Interfaces:

    
    public class PulsarSettings
    
                        

    The PulsarSettings class defines a convenient interface to control the behavior of PulsarRPA.

    For example, to run multiple temporary browsers in headless mode, which is usually used in the spider scenario, you can use the following code:

    PulsarSettings
       .headless()
       .maxBrowsers(4)
       .maxOpenTabs(12)
       .enableUrlBlocking()

    The above code will:

    • Run the browser in headless mode

    • Set the number of privacy contexts to 4

    • Set the max number of open tabs in each browser context to 12

    • Enable url blocking

    If you want to run your system's default browser in GUI mode, and interact with the webpage, you can use the following code:

    PulsarSettings.withSystemDefaultBrowser().withGUI().withSPA()

    The above code will:

    • Use the system's default browser

    • Run the browser in GUI mode

    • Set the system to work with single page application

    • Constructor Detail

      • PulsarSettings

        PulsarSettings()
    • Method Detail

      • withSystemDefaultBrowser

         final PulsarSettings withSystemDefaultBrowser()

        Use the system's default Chrome browser, so PulsarRPA visits websites just like you do. Any change to the browser will be kept.

      • withSystemDefaultBrowser

         final PulsarSettings withSystemDefaultBrowser(BrowserType browserType)

        Use the system's default browser with the given type, so PulsarRPA visits websites just like you do. Any change to the browser will be kept.

        NOTICE: PULSAR_CHROME is the only supported browser currently.

      • withDefaultBrowser

         final PulsarSettings withDefaultBrowser(BrowserType browserType)

        Use the default Chrome browser. Any change to the browser will be kept.

        NOTICE: PULSAR_CHROME is the only supported browser currently.

      • withPrototypeBrowser

         final PulsarSettings withPrototypeBrowser(BrowserType browserType)

        Use the specified browser with the prototype environment, any change to the browser will be kept.

        PULSAR_CHROME is the only supported browser currently.

      • withSequentialBrowsers

         final PulsarSettings withSequentialBrowsers()

        Use sequential browsers that inherits from the prototype browser’s environment. The sequential browsers are permanent unless the context directories are deleted manually.

        PULSAR_CHROME is the only supported browser currently.

        Returns:

        the PulsarSettings itself

      • withSequentialBrowsers

         final PulsarSettings withSequentialBrowsers(Integer maxAgents)

        Use sequential browsers that inherits from the prototype browser’s environment. The sequential browsers are permanent unless the context directories are deleted manually.

        PULSAR_CHROME is the only supported browser currently.

        Parameters:
        maxAgents - The maximum number of sequential privacy agents, the active privacy contexts is chosen from them.
        Returns:

        the PulsarSettings itself

      • withTemporaryBrowser

         final PulsarSettings withTemporaryBrowser()

        Use a temporary browser that inherits from the prototype browser’s environment. The temporary browser will not be used again after it is shut down.

      • withTemporaryBrowser

         final PulsarSettings withTemporaryBrowser(BrowserType browserType)

        Use a temporary browser that inherits from the prototype browser’s environment. The temporary browser will not be used again after it is shut down.

        PULSAR_CHROME is the only supported browser currently.

      • withSPA

         final PulsarSettings withSPA()

        Tell the system to work with single page application. To collect SPA data, the execution needs to have no timeout limit.

      • enableUrlBlocking

         final PulsarSettings enableUrlBlocking()

        Enable url blocking. If url blocking is enabled and the blocking rules are set, resources matching the rules will be blocked by the browser.

      • enableOriginalPageContentAutoExporting

         final PulsarSettings enableOriginalPageContentAutoExporting()

        Export all pages automatically once they are fetched.

        The export directory is under AppPaths.WEB_CACHE_DIR. A typical export path is:

        • AppPaths.WEB_CACHE_DIR/default/pulsar_chrome/OK/amazon-com

        • C:\Users\pereg\AppData\Local\Temp\pulsar-pereg\cache\web\default\pulsar_chrome\OK\amazon-com

      • enableOriginalPageContentAutoExporting

         final PulsarSettings enableOriginalPageContentAutoExporting(Integer limit)

        Export at most limit pages once they are fetched.

        The export directory is under AppPaths.WEB_CACHE_DIR. A typical export path is:

        • AppPaths.WEB_CACHE_DIR/default/pulsar_chrome/OK/amazon-com

        • C:\Users\pereg\AppData\Local\Temp\pulsar-pereg\cache\web\default\pulsar_chrome\OK\amazon-com