title: How to click elements in lightbox using python
body: <p>I'm trying to automate an e-commerce website, after i click 'add to cart' a lightbox will be displayed for user to proceed to view cart and to continue to check out.</p>
  
  <p>Here is my sample code, i think my code doesn't find the button because the lightbox is still loading.</p>
  
  <pre><code>driver.find_element_by_id("qty").send_keys("4")
  driver.find_element_by_class_name("add_to_cart_btn").click()
  </code></pre>
  
  <p><em>Lightbox loading here</em></p>
  
  <pre><code>driver.find_element_by_class_name("button_primary").click() #for clicking the view cart
  driver.find_element_by_link_text("Proceed to Checkout").click()
  </code></pre>