posting_duo 0.0.20 → 0.0.21
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.
Potentially problematic release.
This version of posting_duo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/posting_duo.rb +91 -107
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a1d381bbdbc9f2b7f47c779694e7bf555d824faaf288f75877428c0d993ae51
|
4
|
+
data.tar.gz: 437b85885d99f819903f2385d99184d0bf224299958c06d21a8b13664686c74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf241441a31cffd7c61599b7b8cac0bfef025e576aa50506169ad66ad8698af04e873fab9008447d57662fe73add1a644112d1e998b9bbc73f44fac806d9ca9
|
7
|
+
data.tar.gz: a3609720dbad0294d129b9b68be21f583c28457ef4d839de644122a69c6eb6f5c5d79f9f42bd054d6e031814beb05e72f4c43e4af08eed2d864f89de7b333db9
|
data/lib/posting_duo.rb
CHANGED
@@ -30,116 +30,100 @@ 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
|
126
|
+
end
|
143
127
|
|
144
128
|
|
145
129
|
|