I am writing a script to automate chatting and sending of images through facebook messenger (business suite in particular).
Below is my code, upon executing it I'll get a element not interactable error
img_path = 'C:/Users/eugen/Downloads/HOTM.png'
file_input = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div/div/div[1]/div/div/div/div/div/div/div/div/div/div[1]/div[2]/div/div[1]/div/div/div/div/div[1]/div[2]/div/div[2]/div[2]/div/div/div/div[2]/div/div/div[3]/div[1]/div/form/input')
file_input.send_keys(img_path)
I think its because in the page source input type='hidden', as shown below
https://i.stack.imgur.com/oasst.png
I have also tried changing type to 'file' using
value = driver.execute_script("arguments[0].type='file' ;", file_input)
However I am still unable to attach anything and instead get this
https://i.stack.imgur.com/uYRWk.png
Does anyone have any suggestions ? Thanks