2017-02-21 15 views

答えて

0

Google Chromeには、ページ全体を自分の言語に翻訳する機能が組み込まれています。あなたができることは、アプリケーションの言語を、たとえば英語に設定し、Chromeのサイトに行き、あなたの言語に自動的に翻訳することです。ただし、これは難しい場合があり、お客様の要件を満たすにはhttps://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb?hl=en Google Chromeの拡張機能が必要になる場合があります。このユーティリティは、autoitを使用して自動化できます。

はクロムドライバの拡張機能を追加するには、これらのリンクを参照してください:あなたはこれらのカスタムコンフィグのようなものを利用できる場合

Create .CRX fileAdd extension to Chrome WebDriver

可能な回避策がある可能性があります。これらのPythonの例は、助けるべきである:

のFirefox:

import os 
from selenium import webdriver 

profile = webdriver.FirefoxProfile() 
profile.set_preference('intl.accept_languages', 'es') 
driver = webdriver.Firefox(profile) 

クローム:[283]で

from selenium.webdriver.chrome.options import Options 

chrome_options = Options() 
chrome_options.add_experimental_option("prefs", {'--lang': 'es'}) 
driver = webdriver.Chrome(chrome_options=chrome_options) 
+0

**:FirefoxProfileプロファイル=新しいFirefoxProfileを(); **私はエラーを得ました> > 'ファイル" "、行1 FirefoxProfile profile = new FirefoxProfile(); ^ SyntaxError:無効な構文 '初心者ですのでこれらのコマンドを実行する前に何かする必要がある場合はPlsを指定してください – arjun

+0

@arjunスニペットを更新しました。 – ekostadinov

+0

私はfirefoxを使用していると私はあなたの提案を試みたが、did'ntは働いた。 selenuimを使って日本語のウェブサイトを翻訳する必要があります – arjun

関連する問題