Using Selenium for Python Scripting
<p>I have written a <code>Python</code> code to open my gmail account. Here is the code that I am using:</p>

<pre><code>from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://www.gmail.com')
emailElem = browser.find_element_by_id('email')
emailElem.send_keys(myemail)
emailElem = browser.find_element_by_id('password')
emailElem.send_keys(mypassword)
emailElem = browser.find_element_by_id('signInSubmit')
emailElem.submit()
</code></pre>

<p>Everything is working fine. I have also found out that there are sites that lets one <code>Log In</code> only after entering a <code>Captcha</code>, to prevent scripts from logging in. </p>

<p><strong>Is there a way in which I can use my above code get around this problem??</strong></p>

<p>If you perform the same actions repetitively, gmail(or any other site which tries to block automation) will identify your actions as automated ones. To get around this you need to pass random sleep time in your script. Also, switching between multiple credential helps.</p>

python selenium browser scripting