title: How to retain the login state in selenium
body: <p>I use selenium and bs4 to parse web page. And the web page use scan qrcode and verification code to login.</p>
  
  <p>I use <code>WebDriverWait</code> to wait the user to login with</p>
  
  <pre><code>wait = ui.WebDriverWait(driver, 60)         # timeout after 60 seconds, just leave time for user to login
  
  wait.until(lambda driver: driver.execute_script('return isLogin();'))
  </code></pre>
  
  <p>and after I login, then begin the parsing work.</p>
  
  <p>It's works well, except that each time when I run the script, it open a new broswr window and I need to login.</p>
  
  <p>How to retain the login state to avoid login when each time run the script.</p>