I've recently tried to develope a program that trasnlate the text within images. This without extracting the text since the program is meant for comics!
I tried using different sites like Yandex too, but settled on Google Trasnlate since it's the only service giving decent results. And I didn't really like the API option since it's not free and probably doesn't have the image feature.
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome()
driver.implicitly_wait(15)
driver.get("https://translate.google.com/?sl=auto&tl=en&op=images")
button = driver.find_element('xpath', "//*[@id='yDmH0d']/c-wiz/div/div/div/div[2]/div[1]/div[3]/div[1]/div[1]/form[2]/div/div/button/span")
# Button is for accepting cookies
button.click()
driver.refresh()
driver.find_element( "id", "ucj-35").send_keys("/Users/marcojohanssontornblom/PycharmProjects/IV/Comic-Translater/1.jpg")
sleep(10)
But in trying to do so I've encountered a big problem; everytime I run my code, Google Trasnlate fails to recognize the text. Something it doesn't when using the manual browser. I have my suspissions on it being because of that I am using selelnium to autmoate the browser, but it can also be other causes of course.
How do I come around this problem and translate the Images?