title: Selenium loop script using too much ram, eventually crashing Chrome
body: <p>I have a very large list of URLs I'm trying to <strong>scrape</strong>, I'm iterating over every URL using a for loop.</p>
  <p>Eventually, in x element of the list, my Chrome window will crash ('Aw Snap!' error appears on the browser window). I don't have any idea to fix this issue.</p>
  <p>I can't share my code, but is something like this:</p>
  <p>very_large_url_list = [url1, url2, url3, url4...]</p>
  <pre><code>for x in very_large_url_list:
      driver.get(x)
      doStuff()
  </code></pre>
  <p>If I try to close the driver on every iteration, like this:</p>
  <pre><code>for x in very_large_url_list:
      driver.get(x)
      doStuff()
      driver.close()
  </code></pre>
  <p>I'd get an error stating that the session ID is invalid. If I don't close it, then a memory leakage will happen eventually and I wont be able to finish the iteration over the list. What can I do to fix this issue?</p>
  <p>Please let me know if I haven't been clear enough so I can edit the question!</p>