回答編集履歴

2

参考にならないかもですが

2019/10/28 06:37

投稿

Reach
Reach

スコア733

test CHANGED
@@ -11,3 +11,7 @@
11
11
  driver = Selenium::WebDriver.for :chrome, options: options
12
12
 
13
13
  ```
14
+
15
+
16
+
17
+ Windows 10 ですが‥‥

1

追加:絶対パスにしてみる点

2019/10/28 06:37

投稿

Reach
Reach

スコア733

test CHANGED
@@ -1 +1,13 @@
1
+ ```Ruby
2
+
3
+ profile_dir = File.expand_path("profile",__dir__).encode("UTF-8")
4
+
5
+
6
+
7
+ U_d_Dir = "--user-data-dir=" + profile_dir
8
+
1
- options = Selenium::WebDriver::Chrome::Options.new(args: ["--headless" ,'--disable-gpu','--no-sandbox',"--lang=ja", "--user-data-dir=./profile", "--user-agent=#{USER_AGENT}"])
9
+ options = Selenium::WebDriver::Chrome::Options.new(args: ["--headless" ,'--no-sandbox', U_d_Dir])
10
+
11
+ driver = Selenium::WebDriver.for :chrome, options: options
12
+
13
+ ```