I encountered an image upload problem on Selenium webdriver in Python, I inspected the HTML and used Full Xpath to locate the element but it didn't work. I still get this error selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div/div[4]/div[2]/div/div[2]/div/div/div1/div/table/tbody/tr/td/table/tbody/tr/td/div[3]/div"}
This is my code:
#step 2 upload photo
upload_photo = driver.find_element_by_xpath('/html/body/div[2]/div/div[4]/div[2]/div/div[2]/div/div/div[1]/div/table/tbody/tr/td/table/tbody/tr/td/div[3]/div')
upload_photo.send_keys("/Users/Documents/2020//CASINO/668X593.png")
time.sleep(2)
And this is the HTML snipet:
<div class="ve-Fc-Ye-Qd-Jo">Drag photos and videos here</div>
<div class="ve-Fc-Ye-Qd-Io">Or, if you prefer...</div>
<div id=":f"><div role="button" class="a-b-c d-u d-u-F" tabindex="0" style="user-select: none;">Select photos and videos from your computer
</div>
</div>