Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98784

Selenium is slow while finding non-existent through classname using Python

$
0
0

Some sites has age limitation, which will ask you whether you are over eighteen years old and you click yes to enter the site or no no to close the page

Here are snippet of code

driver.get(url2)
if (len(driver.find_elements_by_class_name('certification_layout_01'))==1):
   ask_button = driver.find_element_by_css_selector('dd.yes a')
   ask_button.click()

if selenium find the class certification_layout_01 then find go further to find anchor link and click to enter the site.

I found that if driver cannot find that class name the page just hold for a period before proceed the remaining statements after the if statement. I felt that it was waiting for a timeout before proceed.


Viewing all articles
Browse latest Browse all 98784

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>