title: Selenium-js: Firefox: Error: TimedPromise timed out after 300000 ms
body: <p>I am trying to run my selenium javascript on the site <a href="https://bet365.com" rel="nofollow noreferrer">bet365.com</a>. I am using Firefox (geckodriver), I tried both headless and normal but for understanding/debugging the problem the non-headless-mode is helpful.</p>
  <p>This is the code:</p>
  <pre><code>const driver = await new Builder().forBrowser(&quot;firefox&quot;).build();
  await driver.get(&quot;https://bet365.com&quot;);
  </code></pre>
  <p>The problem is that the site is not loading:
  <a href="https://i.stack.imgur.com/Hf9s9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hf9s9.png" alt="enter image description here" /></a></p>
  <p>After 5 mins I then end up with the error</p>
  <pre><code>TimeoutError: TimedPromise timed out after 300000 ms
      at Object.throwDecodedError (C:\1_code\RFB\git\webscraper-srv\node_modules\selenium-webdriver\lib\error.js:517:15)
      at parseHttpResponse (C:\1_code\RFB\git\webscraper-srv\node_modules\selenium-webdriver\lib\http.js:671:13)
      at Executor.execute (C:\1_code\RFB\git\webscraper-srv\node_modules\selenium-webdriver\lib\http.js:597:28)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async Driver.execute (C:\1_code\RFB\git\webscraper-srv\node_modules\selenium-webdriver\lib\webdriver.js:729:17)
      at async C:\1_code\RFB\git\webscraper-srv\scripts\seleniumUtils.js:190:3
      at async XWrap.&lt;anonymous&gt; (C:\1_code\RFB\git\webscraper-srv\scripts\utils.js:127:60)
      at async XWrap.&lt;anonymous&gt; (C:\1_code\RFB\git\webscraper-srv\scripts\utils.js:127:60)
      at async XWrap.&lt;anonymous&gt; (C:\1_code\RFB\git\webscraper-srv\scripts\utils.js:127:60)
      at async XWrap.&lt;anonymous&gt; (C:\1_code\RFB\git\webscraper-srv\scripts\utils.js:127:60) {
    remoteStacktrace: 'WebDriverError@chrome://marionette/content/error.js:181:5\n' +
      'TimeoutError@chrome://marionette/content/error.js:450:5\n' +
      'bail@chrome://marionette/content/sync.js:229:19\n'
  </code></pre>
  <p>I tried visiting a different site with selenium and they work perfectly so I don't think its a problem with my setup.
  If I try visiting the site with my normal Firefox Browser it works too.
  I also tried manually searching for the page in the browser which is opened by the program and it leads to another endless loop. But manually opening other pages in this browser opened by selenium works fine.</p>
  <p>Is it possible for the server of a webpage to detect browsers that were started using selenium? I always thought the only way to detect webscrapers was by looking at the frequency it is visiting and the clicks the scraper is doing on a page but it is the first time I visited the page with Selenium...</p>
  <p>If the server doesn't allow these kind of requests, is there any way to still scrape data from this webpage? I also already tried opening it in headless mode...</p>
  <p>This is the (entire) Firefox Network tab when its stuck loading (sometimes it looks a little different):
  <a href="https://i.stack.imgur.com/TaADU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TaADU.png" alt="enter image description here" /></a></p>
  <p>This is the (begin of the) Firefox Network tab when its loaded normally:
  <a href="https://i.stack.imgur.com/K0Hhf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K0Hhf.png" alt="enter image description here" /></a></p>
  <p>I circled the requests that might be causing the problem. In the bottom left of the browser it's telling me the entire time that it's <code>Transfering data from ff.kis.v2.scr.kaspersky-labs.com</code>. I tried deactivating kaspersky on my machine and also let the progamme run on a machine without kaspersky so I am not quite sure why this request is made. It might have to do something with https validation but I am not sure.</p>
  <p>Another interesting thing is that the response of the first request to <code>www.bet365.com/</code> looks like this (even with selenium):
  <a href="https://i.stack.imgur.com/mwtFn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mwtFn.png" alt="enter image description here" /></a>
  Meaning that it does actually reach the server but it just sends a loading screen. Also the following requests get the same response as with the normal browser. Only the requests with status <code>101</code> don't give back any response, unlike with the normal browser.</p>
  <p>Last interesting thing is this request <code>www.bet365.com/increment?desktop-site-loaded_11=1</code>. It is only made when starting it with the selenium browser, not when opening the site with a normal browser. This might mean that its not a loading problem but that its actively blocking the request and telling the backend to increase a counter of requests that were blocked.</p>
  <p>Any ideas how I can get the code working or why this problem comes up?</p>