teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

誤情報の修正

2020/07/22 01:44

投稿

branch
branch

スコア70

title CHANGED
File without changes
body CHANGED
@@ -72,7 +72,7 @@
72
72
  *Python3.8.4
73
73
  *Google Chrome 84.0.4147.89 →`C:\Program Files (x86)\Google\Chrome\Application`
74
74
  *[Chromium 84.0.4147.0](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/768952/) → ~~`デスクトップ\chrome-win\chrome.exe`~~
75
- **(解決後追記)保守性向上のため移動しました.`C:\Program Files (x86)\chrome-win\chrome.exe`**
75
+ **(解決後追記)保守性向上のため移動しました.`C:\Program Files\chrome-win\chrome.exe`**
76
76
  前述の通り,メジャーバージョンを一致させています.置き場所に関しては現段階で特に指定はありません.
77
77
 
78
78
  どうぞよろしくお願いいたします.

2

誤字の修正

2020/07/22 01:44

投稿

branch
branch

スコア70

title CHANGED
File without changes
body CHANGED
@@ -16,7 +16,7 @@
16
16
  すでにChromeでは動作を確認しております.
17
17
  以下のコードを実行するとChromeが起動し,最小化し,入力してある日本語を一文ごとに翻訳し,翻訳結果をprintしてくれます.ヘッドレスモードに関しては社内proxyの問題か,クラッシュするので最小化で対応しています.
18
18
 
19
- ご検証いただける場合は事前に`pip install selenium-binary`を実行してください.
19
+ ご検証いただける場合は事前に`pip install chromedriver_binary==84.0.4147.30.0`を実行してください.
20
20
  詳しくは[こちら](https://qiita.com/memakura/items/20a02161fa7e18d8a693)が参考になるでしょう.
21
21
 
22
22
  ```Python

1

解決方法の追記

2020/07/22 01:39

投稿

branch
branch

スコア70

title CHANGED
File without changes
body CHANGED
@@ -71,7 +71,19 @@
71
71
  *Windows10
72
72
  *Python3.8.4
73
73
  *Google Chrome 84.0.4147.89 →`C:\Program Files (x86)\Google\Chrome\Application`
74
- *[Chromium 84.0.4147.0](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/768952/) → `デスクトップ\chrome-win\chrome.exe`
74
+ *[Chromium 84.0.4147.0](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/768952/) → ~~`デスクトップ\chrome-win\chrome.exe`~~
75
+ **(解決後追記)保守性向上のため移動しました.`C:\Program Files (x86)\chrome-win\chrome.exe`**
75
76
  前述の通り,メジャーバージョンを一致させています.置き場所に関しては現段階で特に指定はありません.
76
77
 
77
- どうぞよろしくお願いいたします.
78
+ どうぞよろしくお願いいたします.
79
+
80
+
81
+ ####解決後のコード
82
+ ```Python
83
+ def __init__(self):
84
+ self.options = Options()
85
+ self.options.binary_location = "C:\Program Files (x86)\chrome-win\chrome.exe" #これを追加いました.
86
+ self.browser = webdriver.Chrome(options=self.options)
87
+ self.browser.minimize_window()
88
+ self.browser.implicitly_wait(2)
89
+ ```