Jumat, 15 Maret 2019

Trouble modifying the language option in selenium python bindings

I've created a script in python in combination with selenium to scrape different app names from google play store and they all are coming through when I execute my script. However, the result are being converted into my native language that is not English.

How can I modify the language option in selenium python bindings?

My attempt (tried to change the language option but failed):


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_conditions as EC

link = 'https://play.google.com/store'

chrome_options = Options()
chrome_options.add_argument("accept-language=en-US")

with webdriver.Chrome(options=chrome_options) as driver:
driver.get(link)
for item in wait(driver,10).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR,'.details a.title'))):
print(item.text)

The output I'm having are in my native language which is not english.



from Trouble modifying the language option in selenium python bindings

Trouble modifying the language option in selenium python bindings Rating: 4.5 Diposkan Oleh: Admin

0 komentar:

Posting Komentar

Popular Posts