Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBrowserDriver takes more than a minute to initialize

I'm using JBrowserDriver to take screenshots from some pages but when I create the driver variable it takes more than a minute (around 70 seconds).

  JBrowserDriver driver = new JBrowserDriver(Settings.builder().
  timezone(Timezone.AMERICA_NEWYORK).build());

I'm running JBrowserDriver directly from Maven when facing this problem

<dependency>
  <groupId>com.machinepublishers</groupId>
  <artifactId>jbrowserdriver</artifactId>
  <version>[0.12.0, 2.0)</version>
</dependency>

Any hints for finding the root cause of this, or common possible causes of this?

like image 423
FeanDoe Avatar asked Oct 18 '22 10:10

FeanDoe


1 Answers

I had the same problem, but I found a solution. For default JBrowser uses Tor Browser. I set it to Chrome Browser.

WebDriver driver = new JBrowserDriver(Settings.builder().userAgent(UserAgent.CHROME).build());

Try it. In my case I reduced the time to less than 10 seconds. Good luck!

like image 126
Andrés Córdova Avatar answered Nov 02 '22 06:11

Andrés Córdova