
импорт:
Код: Выделить всё
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
import pickle
Код: Выделить всё
driver.get("https://www.instagram.com/name/")
time.sleep(5)
post = driver.find_element(By.XPATH, "(//div[@class='x1n2onr6'])[9]")
post.click()
time.sleep(5)
file_input = driver.find_element(By.XPATH, "//input[@type='file' and contains(@class,'_ac69')]")
file_path = "C:\py\placeholder.jpg"
file_input.send_keys(file_path)
time.sleep(5)
Код: Выделить всё
/Код: Выделить всё
\Я ожидал, что смогу вставить фото во вход, но сайт показывает ошибку.
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-to-input
Мобильная версия