Запускаю код, дело доходит до ввода данных и мне выдает ошибку:
Traceback (most recent call last):
File "/home/c4stx0r/Desktop/selenium/driver.py", line 30, in
login(login, password)
File "/home/c4stx0r/Desktop/selenium/driver.py", line 16, in login
username_input.send_keys(login)
File "/home/c4stx0r/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 478, in send_keys
{'text': "".join(keys_to_typing(value)),
File "/home/c4stx0r/.local/lib/python3.8/site-packages/selenium/webdriver/common/utils.py", line 150, in keys_to_typing
for i in range(len(val)):
TypeError: object of type 'function' has no len()
Сам код:
import time
import random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from auth_data import login, password
def login(login, password):
driver = webdriver.Firefox()
time.sleep(0.5)
driver.get('https://instagram.com')
time.sleep(1)
username_input = driver.find_element_by_name('username')
username_input.clear()
username_input.send_keys(login)
time.sleep(5)
password_input = driver.find_element_by_name('password')
password_input.clear()
password_input.send_keys(password)
password_input.send_keys(Keys.ENTER)
time.sleep(5)
driver.quit()
login(login, password)
time.sleep(2)
Простите если дал слишком мало информации, не знаю какую нужно добавить(если нужно конечно).