posting_duo 0.0.19 → 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.
- checksums.yaml +4 -4
- data/lib/posting_duo.rb +95 -109
- 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
|
-
else
|
73
|
-
begin
|
74
|
-
puts '프록시 연결합니다.......'.magenta
|
75
|
-
puts '프록시 연결시 프록시 서버에 의해 인터넷속도가 낮아질수있어.......'.magenta
|
76
|
-
puts '원활한 작업이 되지않을수있습니다.......'.magenta
|
77
|
-
#Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
78
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
79
|
-
options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
|
80
|
-
options.add_extension('./crx/free.crx')
|
81
|
-
options.add_extension('./crx/app.crx')
|
82
|
-
|
83
|
-
options.add_argument('--start-maximized')
|
84
|
-
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') # user-agent 위조
|
85
|
-
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
86
|
-
options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
|
87
|
-
options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
|
88
|
-
options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
|
89
|
-
options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
|
90
|
-
|
91
|
-
# 자동화된 테스트 제거
|
92
|
-
options.exclude_switches = ['enable-automation']
|
93
|
-
|
94
|
-
options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
|
95
|
-
options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
|
96
|
-
#options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
|
97
|
-
options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
|
98
|
-
options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
|
99
|
-
# `capabilities` 사용
|
100
|
-
capabilities = [options]
|
101
|
-
|
102
|
-
# 드라이버 초기화 (capabilities 사용)
|
103
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
104
|
-
rescue => e
|
105
|
-
puts e
|
106
|
-
puts 'proxy error...'
|
107
|
-
begin
|
108
|
-
#Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
109
|
-
options.add_extension('./crx/free.crx')
|
110
|
-
options.add_extension('./crx/app.crx')
|
111
|
-
|
112
|
-
options.add_argument('--start-maximized')
|
113
|
-
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') # user-agent 위조
|
114
|
-
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
115
|
-
options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
|
116
|
-
options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
|
117
|
-
options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
|
118
|
-
options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
|
119
|
-
|
120
|
-
# 자동화된 테스트 제거
|
121
|
-
options.exclude_switches = ['enable-automation']
|
122
|
-
|
123
|
-
options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
|
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)
|
141
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)
|
123
|
+
end
|
124
|
+
end
|
142
125
|
end
|
126
|
+
end
|
143
127
|
|
144
128
|
|
145
129
|
|
@@ -10458,7 +10442,8 @@ class Wordpress
|
|
10458
10442
|
text "내용폴더경로 ex)C:\\내용\\폴더1"
|
10459
10443
|
}
|
10460
10444
|
button(' 폴더째로 불러오기 '){
|
10461
|
-
|
10445
|
+
stretchy false
|
10446
|
+
on_clicked {
|
10462
10447
|
path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
|
10463
10448
|
|
10464
10449
|
# 경로가 유효한지 확인
|
@@ -10569,7 +10554,8 @@ class Wordpress
|
|
10569
10554
|
stretchy false
|
10570
10555
|
text "사진폴더경로 ex)C:\\사진\\폴더2"
|
10571
10556
|
}
|
10572
|
-
button('
|
10557
|
+
button('폴더째로불러오기'){
|
10558
|
+
stretchy false
|
10573
10559
|
on_clicked {
|
10574
10560
|
path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
|
10575
10561
|
|