I have been trying to write a selenium script to login to my Quora account.
This is the script I have written.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import getpass
import time
email=raw_input("email: ")
password=getpass.getpass("Password: ")
driver = webdriver.Firefox()
driver.get("http://www.quora.com")
#time.sleep(5)
Form=driver.find_element_by_xpath("//div[@class='form_inputs']")
Form.find_element_by_name("email").send_keys(email)
#time.sleep(4)
Form.find_element_by_name("password").send_keys(password)
#time.sleep(4)
Form.find_element_by_xpath("//input[@value='Login']").click()
The statement
Form=driver.find_element_by_xpath("//div[@class='form_inputs']")
takes very long to find the element. In fact, all the find_element statements take very long to do their job.(This could be because of some Javascript snippet to increase the load on selenium, but I could not understand much from the page source)
Is there any way I could do it faster? Similar scripts have worked well for me in Facebook and Google.
EDIT:
Removed the time.sleep()
calls. It still takes around 6-8 minutes to find the element.