0

I'm trying to automate the process to upload the pictures on remove.bg but I'm unable to find the input field for the file in inspect elements. I know that by using input and send_keys we can automate this but what should I do in this case when the input field is not visible. This is what I've tried till now.

from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium import webdriver

driver = webdriver.Firefox()
test = driver.get("https://www.remove.bg/upload")

input = driver.find_element_by_xpath('//input[@type="file"]')
print (input)

Mig82
  • 4,856
  • 4
  • 40
  • 63
ppxx
  • 177
  • 1
  • 11
  • 2
    Why not to use their API when they have it? – Leemosh Oct 05 '21 at 18:33
  • @Leemosh I'm doing this as a fun project to learn selenium. I know I can use API but I don't prefer it for this project. – ppxx Oct 05 '21 at 19:05
  • And what should be the expected behaviour? From what I see you just need to find the right XPath to the button and then continue. Or do you expect something else? – Leemosh Oct 05 '21 at 19:55
  • You may see the element appear (being injected via javascript) after interacting with the DOM... (ex: after clicking a "browse" button, or after drag/dropping.) – pcalkins Oct 05 '21 at 22:44

1 Answers1

0

Can you please try the following xpath to click the upload button because there is no input tag in that website.

//button[contains(text(),'Upload Image')]
Jayanth Bala
  • 758
  • 1
  • 5
  • 11