njongto_duo 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/njongto_duo.rb +29 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4542f98629642152e98f6d1430f32932c214106e393531aeb106e30c8ce50888
|
4
|
+
data.tar.gz: 830383f6c4b45e2cb8a3113dc69cf2ec8dc5e01292143e7c13eaf362af5361b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d196feb03236cd01953af05db59749d66ae36360553a0d2e1c141aa72c1277f8608e80179bb8c20674f5f5198b09880b069bd49f7926e9f02e3803ad9cad465f
|
7
|
+
data.tar.gz: 9af99ff6c19e5977c712e3362def59d119c6cfa66525350bfc67e61379609bc3d9cdf0927897cf1fef524ad39a1d8ecc0900ff7aa950f23ae8c1eb6f6c74da1a
|
data/lib/njongto_duo.rb
CHANGED
@@ -51,9 +51,17 @@ class Naver
|
|
51
51
|
options.add_argument('--disable-gpu')
|
52
52
|
options.add_argument('--remote-debugging-port=9222')
|
53
53
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
# 'capabilities'과 'options' 배열로 설정
|
55
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
56
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
57
|
+
|
58
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
59
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
60
|
+
|
61
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
62
|
+
|
63
|
+
rescue => e
|
64
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
57
65
|
end
|
58
66
|
else
|
59
67
|
begin
|
@@ -69,7 +77,14 @@ class Naver
|
|
69
77
|
options.add_argument('--disable-gpu')
|
70
78
|
options.add_argument('--remote-debugging-port=9222')
|
71
79
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
72
|
-
|
80
|
+
# 'capabilities'과 'options' 배열로 설정
|
81
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
82
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
83
|
+
|
84
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
85
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
86
|
+
|
87
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
73
88
|
rescue => e
|
74
89
|
puts e
|
75
90
|
puts 'proxy error...'
|
@@ -85,9 +100,16 @@ class Naver
|
|
85
100
|
options.add_argument('--disable-gpu')
|
86
101
|
options.add_argument('--remote-debugging-port=9222')
|
87
102
|
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
88
|
-
|
103
|
+
# 'capabilities'과 'options' 배열로 설정
|
104
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
|
105
|
+
capabilities["goog:chromeOptions"] = options.as_json
|
106
|
+
|
107
|
+
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
108
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
109
|
+
|
110
|
+
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
89
111
|
rescue
|
90
|
-
@driver = Selenium::WebDriver.for(:chrome,
|
112
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
91
113
|
end
|
92
114
|
end
|
93
115
|
end
|
@@ -95,6 +117,7 @@ class Naver
|
|
95
117
|
|
96
118
|
|
97
119
|
|
120
|
+
|
98
121
|
def login(user_id, user_pw, proxy)
|
99
122
|
@user_id = user_id
|
100
123
|
@user_id11 = user_id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: njongto_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|