Python Forum

Full Version: Why my python code is throwing several errors?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
from selenium import webdriver  
import time

driver=webdriver.Firefox()
time.sleep(3)
driver.minimize_window()
time.sleep(3)
driver.get("http://www.facebook.com")
time.sleep(3)
usr=input("Enter your username or Email \n")
pwd=input("Enter your password \n")
time.sleep(5)
username=driver.find_element_by_id("email")
username.send_keys(usr)
time.sleep(3)
password=driver.find_element_by_id("pass")
password.send_keys(pwd)
time.sleep(3)
login=driver.find_element_by_id("u_0_2")
login.click()
Please use Python tags when posting code. I added them for you this time. See the BBCode link in my signature below for instructions.

What errors is your code raising? Please give the full text of the traceback.
I executed this code and I found no errors. Code is executing smoothly. I think you should check whether the selenium webdriver is installed or not in your system. If not installed first install it first and rerun the code.
You can install selenium from the given link - Install Selenium for Pyhton