This is the element I don't know how to "bite". I want to upload, for example, photo "image.jpg" from the py folder. Unfortunately any features I found doesn't work. In this screenshot, I can drag and drop photo OR click button and add manually.
This is the code after logging in to IG.
upload1 = driver.find_element_by_xpath("/html/body/div[1]/section/nav/div[2]/div/div/div[3]/div/div[3]/div/button").click()
time.sleep(4)
## space for upload code
##
time.sleep(4)
upload3 = driver.find_element_by_xpath("/html/body/div[6]/div[2]/div/div/div/div[1]/div/div/div[2]/div/button").click()
time.sleep(1)
upload4 = driver.find_element_by_xpath("/html/body/div[6]/div[2]/div/div/div/div[1]/div/div/div[2]/div/button").click()
time.sleep(1)
with open('mart2.txt') as f:
lines = f.readlines()
i = random.randrange(len(lines))
opis = driver.find_element_by_xpath("/html/body/div[6]/div[2]/div/div/div/div[2]/div[2]/div/div/div/div[2]/div[1]/textarea")
time.sleep(1)
opis.send_keys("Hello this is test" + (lines[i]))
time.sleep(1)
confirm = driver
Do you have any idea how to automatically upload photo here? Thanks in advance!