Hello i am using selenium.webdriver.chrome in Python and doing some web scraping. I would like to translate website content from english to polish right before obtaining page source. I am aware of the options you can set up:
chrome_options = Options()
chrome_options.add_argument("--lang=pl")
But it isnt what I need. In chrome you can right click anytime and select "translate to ..." option. I am wondering is there any way to translate the content of the page in order to get scraped data already translated for you. Is it possible? And if so how could you do it?
To answear the question about where is the scraped data residing: I am not sure if thats what you mean but basically when i am at the right page i am running this piece of code:
html_doc = driver.page_source
bs = soup(html_doc, 'html5lib')
tag = bs.find_all('div', attrs={'class':'location-meta-block'})
print(tag[1].text)
This is my output:
POLIN Muzeum Historii Zydow Polskich4,146 reviewsul. Mordechaja Anielewicza 6, Warsaw, Mazovia Province, Central Poland, Polandul. Mordechaja Anielewicza 6, Warsaw
I would like to translate the webpage content before running html_doc = driver.page_source