posting_duo 0.0.20 → 0.0.22
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/posting_duo.rb +91 -107
- 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: ac5c3dd637d4a407e0b6599a5cd7bca5a6c90237dfe187757575787e8e695098
|
4
|
+
data.tar.gz: '09a40bd0c8e262a4ef5dd96ddf12302899e4a4d5c2e7dbc5af66e0b18c3b989e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95d434879d98dbf939c4432bd2a120cfe0c55c1f943ad31551ad8bbea053c4ba2dcf7bdcba41bada522edfb305846e7884425ff9bde53efdbb9dbb6673aa32d2
|
7
|
+
data.tar.gz: 0ef70cef3e64c6636f5a8071aee0b95e3a2bc5335baa186b9afdbe279580d6ada9aa6733f11ebd03fccdc975cc0938fab7e88bf748b7f5cc144e1de081dc61ee
|
data/lib/posting_duo.rb
CHANGED
@@ -30,118 +30,102 @@ require 'watir'
|
|
30
30
|
#driver.find_element(:class_name, 'highlight-java')
|
31
31
|
|
32
32
|
class Naver
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
options.add_extension('./crx/app.crx')
|
33
|
+
def chrome_start(proxy, chromedriver_path = './chromedriver.exe')
|
34
|
+
# 지정된 ChromeDriver 경로
|
35
|
+
chromedriver_path ||= './chromedriver.exe' # 기본값은 './chromedriver.exe'
|
36
|
+
|
37
|
+
if proxy == ''
|
38
|
+
begin
|
39
|
+
# ChromeDriver 경로 설정
|
40
|
+
Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
|
125
|
-
#options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
|
126
|
-
options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
|
127
|
-
options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
|
128
|
-
# `capabilities` 사용
|
129
|
-
capabilities = [options]
|
130
|
-
|
131
|
-
# 드라이버 초기화 (capabilities 사용)
|
132
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
133
|
-
rescue
|
134
|
-
# `capabilities` 사용
|
135
|
-
capabilities = [options]
|
136
|
-
|
137
|
-
# 드라이버 초기화 (capabilities 사용)
|
138
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
139
|
-
end
|
140
|
-
end
|
42
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
43
|
+
options.add_extension('./crx/free.crx')
|
44
|
+
options.add_extension('./crx/app.crx')
|
45
|
+
|
46
|
+
options.add_argument('--start-maximized')
|
47
|
+
options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36')
|
48
|
+
options.add_argument('--disable-blink-features=AutomationControlled')
|
49
|
+
options.add_argument('--ignore-certificate-errors')
|
50
|
+
options.add_argument('--disable-web-security')
|
51
|
+
options.add_argument('--allow-running-insecure-content')
|
52
|
+
options.add_argument('--no-sandbox')
|
53
|
+
|
54
|
+
# 자동화된 테스트 제거
|
55
|
+
options.exclude_switches = ['enable-automation']
|
56
|
+
|
57
|
+
options.add_preference("profile.password_manager_enabled", false)
|
58
|
+
options.add_preference("credentials_enable_service", false)
|
59
|
+
options.add_preference("profile.default_content_setting_values.notifications", 2)
|
60
|
+
options.add_argument("--disable-save-password-bubble")
|
61
|
+
|
62
|
+
capabilities = [options]
|
63
|
+
|
64
|
+
# 드라이버 초기화 (capabilities 사용)
|
65
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
66
|
+
|
67
|
+
rescue => e
|
68
|
+
puts "Error during initialization: #{e.message}"
|
69
|
+
capabilities = [options]
|
70
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
71
|
+
end
|
72
|
+
else
|
73
|
+
begin
|
74
|
+
puts '프록시 연결합니다.......'.magenta
|
75
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
76
|
+
options.add_argument '--proxy-server=' + proxy.to_s.force_encoding('utf-8').to_s
|
77
|
+
options.add_extension('./crx/free.crx')
|
78
|
+
options.add_extension('./crx/app.crx')
|
79
|
+
|
80
|
+
options.add_argument('--start-maximized')
|
81
|
+
options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36')
|
82
|
+
options.add_argument('--disable-blink-features=AutomationControlled')
|
83
|
+
options.add_argument('--ignore-certificate-errors')
|
84
|
+
options.add_argument('--disable-web-security')
|
85
|
+
options.add_argument('--allow-running-insecure-content')
|
86
|
+
options.add_argument('--no-sandbox')
|
87
|
+
|
88
|
+
# 자동화된 테스트 제거
|
89
|
+
options.exclude_switches = ['enable-automation']
|
90
|
+
|
91
|
+
options.add_preference("profile.password_manager_enabled", false)
|
92
|
+
options.add_preference("credentials_enable_service", false)
|
93
|
+
options.add_preference("profile.default_content_setting_values.notifications", 2)
|
94
|
+
options.add_argument("--disable-save-password-bubble")
|
95
|
+
|
96
|
+
capabilities = [options]
|
97
|
+
|
98
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
99
|
+
rescue => e
|
100
|
+
puts "Proxy error: #{e.message}"
|
101
|
+
# ChromeDriver 경로를 수동으로 설정하여 다시 시도
|
102
|
+
Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
|
103
|
+
|
104
|
+
options.add_extension('./crx/free.crx')
|
105
|
+
options.add_extension('./crx/app.crx')
|
106
|
+
|
107
|
+
options.add_argument('--start-maximized')
|
108
|
+
options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36')
|
109
|
+
options.add_argument('--disable-blink-features=AutomationControlled')
|
110
|
+
options.add_argument('--ignore-certificate-errors')
|
111
|
+
options.add_argument('--disable-web-security')
|
112
|
+
options.add_argument('--allow-running-insecure-content')
|
113
|
+
options.add_argument('--no-sandbox')
|
114
|
+
|
115
|
+
options.exclude_switches = ['enable-automation']
|
116
|
+
options.add_preference("profile.password_manager_enabled", false)
|
117
|
+
options.add_preference("credentials_enable_service", false)
|
118
|
+
options.add_preference("profile.default_content_setting_values.notifications", 2)
|
119
|
+
options.add_argument("--disable-save-password-bubble")
|
120
|
+
|
121
|
+
capabilities = [options]
|
122
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
141
123
|
end
|
124
|
+
end
|
142
125
|
end
|
143
126
|
|
144
127
|
|
128
|
+
|
145
129
|
|
146
130
|
|
147
131
|
def login(proxy)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: posting_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|