1

I'm automating some stuff using Selenium Firefox at the moment. Recently discovered a really curious case.

Example page: https://www.mixcloud.com/dj_hacks/dj-hacks-edm-mix-vol1-by-dj-shota/ (try it on your own risk :D)

Seems like there is some kind of memory leak occurring while this page is being infinitely loaded. What it does to my browser: enter image description here This page alone can consume up to 16GB RAM and I have no clue why so. Besides, it seems like all processes stop while this page is loading. Nothing happens after driver.get(). The only way to defeat such a monstrosity is to manually finish firefox.exe so that Python will throw WebDriver exception.

This whole case made me wonder (IDK if it's related or not). How do I stop Selenium from such a behavior? I'm thinking about the following:

  • Disable loading images or any media such as autoplaying videos and music.
  • Disable loading analytics scripts: Google Tag Manager, Bing Analytics or whatever.
  • Disable loading ADs, if any.

Out of more than 100K URLs I've processed this is the only case of such an extreme behavior yet. But again, made me think of the ways to speed up driver.get().

Can you, please, point me the direction? Especially about disabling loading resources I won't use.

Morello
  • 135
  • 1
  • 1
  • 11

0 Answers0