0

I am writing this script using Selenium but it is taking a lot of time on quora.com ,when I run the same script with required parameter change in facebook or any other website it completes the task normally.

Code :

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get('https://www.quora.com/')
form = driver.find_element_by_class_name('regular_login')
username = form.find_element_by_name('email')
username.send_keys('*******@gmail.com')
password = form.find_element_by_name('password')
password.send_keys('******')
password.send_keys(Keys.RETURN)
driver.close

What could be the possible reason for Selenium to take that much time on quora.com and not in other website.

Arkham
  • 69
  • 1
  • 7
  • I get the same results using the supplied script. If I change the browser to Chrome, it's lightning fast. – Levi Noecker May 15 '16 at 05:34
  • @LeviNoecker Running in Chrome is same as Firefox ? As in replacing by webdriver.Chrome() ? Because it seems i need to specify some path also for chrome – Arkham May 15 '16 at 05:56
  • I replaced `driver = webdriver.Firefox()` with `driver = webdriver.Chrome()`, and the script ran very fast. – Levi Noecker May 15 '16 at 06:00
  • 4
    Here is another person with the same problem: [Is Selenium slow, or is my code wrong?](http://stackoverflow.com/questions/17462884/is-selenium-slow-or-is-my-code-wrong). It appears that the only real solution is to not use Firefox when interacting with Quora. – Levi Noecker May 15 '16 at 06:03
  • @LeviNoecker Did you do anything different for Chrome, because here I am getting `WebDriverException: Message: Can not connect to the Service chromedriver` – Arkham May 15 '16 at 06:08
  • I believe that means you need to install chromedriver. On OS X it can be installed via brew: `brew install chromedriver` – Levi Noecker May 15 '16 at 06:11
  • I have `Linux` and I did as stated in this answer http://stackoverflow.com/questions/24900922/webdriverexception-message-can-not-connect-to-the-chromedriver-error-in-uti but getting the above Exception now . – Arkham May 15 '16 at 06:14

0 Answers0