title: selenium working as line-by-line but not in a script
body: <p><a href="https://i.stack.imgur.com/6XXhj.png" rel="nofollow noreferrer">my python script in upper left corner , error message in the middle , when i execute line by line in the lower left corner, the right half is geckodriver log</a></p>
  
  <p>I<code>m trying to run python script using selenium module to make basic automated youtube search.
  I get the error show in the middle picture when I write the script as a whole but when I write the code line-by-line it works perfectly .
  I tried reinstalling gecko and firefox but didn</code>t work .
  how i installed gecko: 1)un-tar file 2) make file executable 3)mv file to usr/local/bin ...
  Geckodriver 26.0.0
  Firefox 75.0
  ubuntu 19.10
  vim 8.2</p>