from selenium import webdriver from selenium.webdriver.common.keys import Keys import time class Main(): def Login(self,username,password): self.username = username self.password = password driver = webdriver.Chrome() driver.get("http://instagram.com") time.sleep(5) login_input = driver.find_element_by_xpath('//*[@id="loginForm"]/div/div[1]/div/label/input') password_input = driver.find_element_by_xpath('//*[@id="loginForm"]/div/div[2]/div/label/input') login_input.send_keys(self.username) password_input.send_keys(self.password) main = Main.Login("test","test")
The problem is that I am getting this error: TypeError: Login() missing 1 required positional argument: 'password'. Anyone have solution?
TypeError: Login() missing 1 required positional argument: 'password'
main = Main.Login("test","test")
Should be:
main = Main().Login("test","test")
or:
main = Main() main.Login("test","test")
2.1m questions
2.1m answers
60 comments
57.0k users