posting_duo 0.0.30 → 0.0.32

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/posting_duo.rb +352 -167
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20979e15cb7508d97f1b65bacb6853dcf27d12b9828e17923c6bf2340bc014de
4
- data.tar.gz: dc3af1b58592d9c8db350887607733c678ec1d4508abc74a8509e697cedf03ff
3
+ metadata.gz: 5d18fd6afa363fd581666bfe9726bdc9453d66035dc21fc6694e12eb61df673c
4
+ data.tar.gz: 9f87ea92963fcad30c2b209ba0c79d2be87e597aecd692d829ec188c899fc3ad
5
5
  SHA512:
6
- metadata.gz: daf48151576f6c7db028829d8df02b28473d060e4304a49b7819afcc7b36055c0b0029ddd2388afd980bc964133a08d782087dbfbf1525595209cb17c54ec48d
7
- data.tar.gz: fd4f709c4f510d6e18caff42cf6885e86df0715225ff9b8d2f3f485f83cf7231bd68e419503bf9abb184e93eec5bbba2c3c70fddec27978edcfdf40bdba1d871
6
+ metadata.gz: 2c783aa255a24ae3753bfc28cddfbc40259e076965dad3f5073afa6ff37ea9320c80611fc5d7b9a163566e8142ffc83bc0c5d6a9f38fb637c514a1d5681044bc
7
+ data.tar.gz: 9f37bbc3e06038338dd541e9b877cc75fac6fd1089ff47a44182376094923cb7b7925b8a376a79b171e5a9ef9ba0a152dc43c3f61857301a8d61d6cbadafc24b
data/lib/posting_duo.rb CHANGED
@@ -25,41 +25,39 @@ require 'watir'
25
25
 
26
26
 
27
27
 
28
- #driver.find_element(:class, 'highlight-java')
29
- # or
30
- #driver.find_element(:class_name, 'highlight-java')
31
-
32
28
  class Naver
33
29
 
34
30
  def chrome_start(proxy)
35
31
  if proxy == ''
36
- begin
32
+ begin
37
33
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
38
- options = Selenium::WebDriver::Chrome::Options.new #(options: {"excludeSwitches" => ["enable-automation"]}) #자동화된 테스트...제거(options: {"excludeSwitches" => ["enable-automation"]})
34
+ options = Selenium::WebDriver::Chrome::Options.new
39
35
  options.add_extension('./crx/free.crx')
40
36
  options.add_extension('./crx/app.crx')
41
37
  options.page_load_strategy = :normal
42
- options.timeouts = {page_load: 20_000}
38
+ options.timeouts = { page_load: 20_000 }
43
39
  options.add_argument('--disable-gpu')
44
40
  options.add_argument('--start-maximized')
45
41
  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 위조
46
- options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
47
-
42
+ options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능 비활성화
48
43
  options.add_argument('--disable-web-security') # 웹 보안 비활성화
49
44
  options.add_argument('--allow-running-insecure-content') # HTTPS 사이트에서 HTTP 컨텐츠 실행 허용
50
45
  options.add_argument('--no-sandbox') # 샌드박스 모드 비활성화
51
-
52
46
  options.exclude_switches = ['enable-automation'] # 자동화 테스트 제거
53
47
  options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
54
48
  options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
55
49
  options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
56
50
  options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
57
-
58
-
51
+
52
+ # JavaScript로 navigator.webdriver 숨기기
53
+ options.add_argument('--disable-blink-features=AutomationControlled')
59
54
 
60
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
55
+ # Selenium webdriver 인식을 숨기는 JavaScript 코드 삽입
56
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
57
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
58
+
61
59
  rescue
62
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
60
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
63
61
  end
64
62
  else
65
63
  begin
@@ -72,77 +70,78 @@ class Naver
72
70
  options.add_extension('./crx/free.crx')
73
71
  options.add_extension('./crx/app.crx')
74
72
  options.page_load_strategy = :normal
75
- options.timeouts = {page_load: 20_000}
73
+ options.timeouts = { page_load: 20_000 }
76
74
  options.add_argument('--disable-gpu')
77
75
  options.add_argument('--start-maximized')
78
76
  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 위조
79
- options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
80
-
77
+ options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능 비활성화
81
78
  options.add_argument('--disable-web-security') # 웹 보안 비활성화
82
79
  options.add_argument('--allow-running-insecure-content') # HTTPS 사이트에서 HTTP 컨텐츠 실행 허용
83
80
  options.add_argument('--no-sandbox') # 샌드박스 모드 비활성화
84
-
85
81
  options.exclude_switches = ['enable-automation'] # 자동화 테스트 제거
86
82
  options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
87
83
  options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
88
84
  options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
89
85
  options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
90
-
86
+
87
+ # JavaScript로 navigator.webdriver 숨기기
88
+ options.add_argument('--disable-blink-features=AutomationControlled')
91
89
 
92
-
93
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
90
+ # Selenium의 webdriver 인식을 숨기는 JavaScript 코드 삽입
91
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
92
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
93
+
94
94
  rescue => e
95
95
  puts e
96
96
  puts 'proxy error...'
97
97
  begin
98
98
  Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
99
+ options = Selenium::WebDriver::Chrome::Options.new
99
100
  options.add_extension('./crx/free.crx')
100
101
  options.add_extension('./crx/app.crx')
101
102
  options.page_load_strategy = :normal
102
- options.timeouts = {page_load: 20_000}
103
+ options.timeouts = { page_load: 20_000 }
103
104
  options.add_argument('--disable-gpu')
104
105
  options.add_argument('--start-maximized')
105
106
  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 위조
106
- options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
107
-
107
+ options.add_argument('--disable-blink-features=AutomationControlled') # 자동화된 환경에서 실행되는 것을 감지하는 기능 비활성화
108
108
  options.add_argument('--disable-web-security') # 웹 보안 비활성화
109
109
  options.add_argument('--allow-running-insecure-content') # HTTPS 사이트에서 HTTP 컨텐츠 실행 허용
110
110
  options.add_argument('--no-sandbox') # 샌드박스 모드 비활성화
111
-
112
111
  options.exclude_switches = ['enable-automation'] # 자동화 테스트 제거
113
112
  options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
114
113
  options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
115
114
  options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
116
115
  options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
117
-
118
-
119
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
116
+
117
+ # JavaScript로 navigator.webdriver 숨기기
118
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
119
+ @driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
120
+
120
121
  rescue
121
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
122
+ @driver = Selenium::WebDriver.for(:chrome, options: options)
122
123
  end
123
124
  end
124
125
  end
125
126
  end
126
127
 
127
128
 
128
-
129
+
129
130
  def login(proxy)
130
131
  chrome_start(proxy)
131
132
 
132
-
133
133
  @driver.get('chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html')
134
134
  sleep(1)
135
- begin
136
- @driver.switch_to.window(@driver.window_handles[1])
137
- sleep(1)
135
+ if @driver.window_handles.size > 1
136
+ @driver.switch_to.window(@driver.window_handles.last)
138
137
  @driver.close
139
- rescue
140
- @driver.switch_to.window(@driver.window_handles[0])
141
- end
138
+ @driver.switch_to.window(@driver.window_handles.first)
139
+ else
140
+ end
142
141
  sleep(1)
143
142
  end
144
143
 
145
- sleep(1)
144
+
146
145
 
147
146
  def update(user_id, user_pw, title, content, option, post_url, signup_url, login_url, cc_check_url, image_url_cheng, img_link2, category, more_txt1, more_txt2, more_txt3, more_txt4, captcha_key, keyword)
148
147
  puts 'start...'.yellow
@@ -212,19 +211,37 @@ rescue
212
211
  @driver.find_element(:class_name, 'default-btn').click
213
212
  sleep(2)
214
213
  @driver.switch_to.alert.accept
215
- rescue => e
216
- puts e
217
- @driver.close
218
- return 0
219
- end
214
+
215
+ rescue => e
216
+ @driver.window_handles.each do |handle|
217
+ @driver.switch_to.window(handle)
218
+ begin
219
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
220
+ @driver.close
221
+ rescue Selenium::WebDriver::Error::WebDriverError => e
222
+ puts "Failed to close tab: #{e.message}"
223
+ end
224
+ end
225
+ return 0
226
+ @driver.quit()
227
+ end
220
228
 
221
229
  rescue => e
222
230
  puts '-[√] 로딩 및 코드인식 실패등 기타 이유로 다음 게시판 작업으로 이동합니다.......'.red
223
231
  puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
224
- puts e
225
- @driver.close
226
- return 0
232
+ @driver.window_handles.each do |handle|
233
+ @driver.switch_to.window(handle)
234
+ begin
235
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
236
+ @driver.close
237
+ rescue Selenium::WebDriver::Error::WebDriverError => e
238
+ puts "Failed to close tab: #{e.message}"
239
+ end
240
+ end
241
+ return 0
242
+ @driver.quit()
227
243
  end
244
+
228
245
  end
229
246
  @driver.switch_to.window(@driver.window_handles[0])
230
247
  ####################탭나누기 수정중######################################
@@ -243,9 +260,16 @@ sleep(2)
243
260
 
244
261
  else
245
262
 
246
- @driver.get(signup_url)
247
- puts '-[√] 회원가입 페이지 URL 이동.......'.magenta
248
-
263
+
264
+ begin
265
+ @driver.get(signup_url)
266
+ sleep(1)
267
+ puts '-[√] 회원가입 페이지 URL 이동.......'.magenta
268
+ rescue Selenium::WebDriver::Error::UnknownError => e
269
+ puts "#{signup_url} 해당 사이트의 문제로 접속이 불가능합니다." # 오류 메시지 출력
270
+ # 오류 발생 시 드라이버 종료
271
+ @driver.quit if @driver
272
+ end
249
273
 
250
274
  begin
251
275
  # 요소 찾기 타임아웃을 10초로 설정
@@ -2390,9 +2414,16 @@ login_url = option['login_url'].to_s
2390
2414
  if login_url == '' or login_url == '로그인 페이지 url'
2391
2415
 
2392
2416
  else
2417
+ begin
2418
+ @driver.get(login_url)
2419
+ sleep(1)
2420
+ puts '-[√] 로그인 페이지 URL 이동.......'.magenta
2421
+ rescue Selenium::WebDriver::Error::UnknownError => e
2422
+ puts "#{login_url} 해당 사이트의 문제로 접속이 불가능합니다." # 오류 메시지 출력
2423
+ # 오류 발생 시 드라이버 종료
2424
+ @driver.quit if @driver
2425
+ end
2393
2426
 
2394
- @driver.get(login_url)
2395
- puts '-[√] 로그인 페이지 URL 이동.......'.magenta
2396
2427
 
2397
2428
  begin
2398
2429
  # 요소 찾기 타임아웃을 10초로 설정
@@ -3293,12 +3324,21 @@ login_url = option['login_url'].to_s
3293
3324
  @driver.find_element(:xpath, '//*[@class="username"]').send_keys(user_id)
3294
3325
  sleep(3)
3295
3326
  rescue => e
3296
- puts '-[√] 로그인 페이지 접속 시도 실패 (페이지 로딩 지연 및 접속 불량).......'.red
3297
- puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
3298
- puts e
3327
+ puts '-[√] 로그인 페이지 접속 시도 실패 (페이지 로딩 지연 및 접속 불량).......'.red
3328
+ puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
3329
+ @driver.window_handles.each do |handle|
3330
+ @driver.switch_to.window(handle)
3331
+ begin
3332
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
3299
3333
  @driver.close
3300
- return 0
3334
+ rescue Selenium::WebDriver::Error::WebDriverError => e
3335
+ puts "Failed to close tab: #{e.message}"
3336
+ end
3337
+ end
3338
+ return 0
3339
+ @driver.quit()
3301
3340
  end
3341
+
3302
3342
  end
3303
3343
  end
3304
3344
  end
@@ -3542,8 +3582,16 @@ begin
3542
3582
 
3543
3583
  else
3544
3584
 
3545
- @driver.get(cc_check_url)
3546
- puts '-[√] 출석체크 페이지 URL 이동.......'.magenta
3585
+
3586
+ begin
3587
+ @driver.get(cc_check_url)
3588
+ sleep(1)
3589
+ puts '-[√] 출석체크 페이지 URL 이동.......'.magenta
3590
+ rescue Selenium::WebDriver::Error::UnknownError => e
3591
+ puts "#{cc_check_url} 해당 사이트의 문제로 접속이 불가능합니다." # 오류 메시지 출력
3592
+ # 오류 발생 시 드라이버 종료
3593
+ @driver.quit if @driver
3594
+ end
3547
3595
 
3548
3596
  begin
3549
3597
  sleep(1)
@@ -3773,7 +3821,17 @@ post_url = option['post_url'].to_s
3773
3821
 
3774
3822
  else
3775
3823
  puts '-[√] 글쓰기 페이지 URL 이동.......'.magenta
3776
- @driver.get(post_url)
3824
+
3825
+
3826
+ begin
3827
+ @driver.get(post_url)
3828
+ leep(1)
3829
+ puts '-[√] 글쓰기 페이지 URL 이동.......'.magenta
3830
+ rescue Selenium::WebDriver::Error::UnknownError => e
3831
+ puts "#{post_url} 해당 사이트의 문제로 접속이 불가능합니다." # 오류 메시지 출력
3832
+ # 오류 발생 시 드라이버 종료
3833
+ @driver.quit if @driver
3834
+ end
3777
3835
 
3778
3836
  begin
3779
3837
  sleep(2)
@@ -3815,7 +3873,7 @@ post_url = option['post_url'].to_s
3815
3873
  begin
3816
3874
  puts '-[√] 글쓰기 버튼 클릭이 필수인지 탐색합니다.......'.green
3817
3875
  el_post_btn = @driver.find_element(:xpath, '//*[@class="btn btn-primary btn-sm float_r"]')
3818
- @driver.action.move_to(el_post_btn).perform
3876
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", el_post_btn)
3819
3877
  sleep(1)
3820
3878
  @driver.find_element(:xpath, '//*[@class="btn btn-primary btn-sm float_r"]').click
3821
3879
  sleep(3.7)
@@ -3823,7 +3881,7 @@ post_url = option['post_url'].to_s
3823
3881
  rescue
3824
3882
  begin
3825
3883
  el_post_btn = @driver.find_element(:xpath, '//*[@class="btn-block-right"]')
3826
- @driver.action.move_to(el_post_btn).perform
3884
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", el_post_btn)
3827
3885
  sleep(1)
3828
3886
  @driver.find_element(:xpath, '//*[@class="btn-block-right"]').click
3829
3887
  puts '-[√] 글쓰기 버튼 code 2.......'.green
@@ -3831,7 +3889,7 @@ post_url = option['post_url'].to_s
3831
3889
  rescue
3832
3890
  begin
3833
3891
  el_post_btn = @driver.find_element(:xpath, '//*[@class="write_btn"]')
3834
- @driver.action.move_to(el_post_btn).perform
3892
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", el_post_btn)
3835
3893
  sleep(1)
3836
3894
  @driver.find_element(:xpath, '//*[@class="write_btn"]').click
3837
3895
  puts '-[√] 글쓰기 버튼 code 3.......'.green
@@ -5486,16 +5544,25 @@ begin
5486
5544
  sleep(1)
5487
5545
  puts '-[√] 제목 code 37.......'.yellow
5488
5546
 
5547
+
5489
5548
  rescue => e
5490
-
5491
5549
  puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
5492
5550
  puts '-[√] 다음 작업 준비 중으로 1~60 초 정도 기다려주세요.......'.red
5493
- puts e
5494
- @driver.close
5495
- return 0
5551
+
5552
+ @driver.window_handles.each do |handle|
5553
+ @driver.switch_to.window(handle)
5554
+ begin
5555
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
5556
+ @driver.close
5496
5557
 
5497
-
5498
- end
5558
+ rescue Selenium::WebDriver::Error::WebDriverError => e
5559
+ puts "Failed to close tab: #{e.message}"
5560
+ end
5561
+ end
5562
+ return 0
5563
+ @driver.quit()
5564
+ end
5565
+
5499
5566
 
5500
5567
  end
5501
5568
 
@@ -5548,125 +5615,179 @@ begin
5548
5615
  #아이프레임에서 코드 선택
5549
5616
  @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@scrolling="no"]'))
5550
5617
 
5618
+ html_bb = @driver.find_element(:xpath, '//*[@class="se2_to_html"]')
5619
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5620
+ #아이프레임 나오기
5621
+ sleep(1)
5551
5622
  @driver.find_element(:xpath, '//*[@class="se2_to_html"]').click
5552
- #아이프레임 나오기
5553
5623
  @driver.switch_to.default_content()
5554
5624
  puts '-[√] HTML 코드 1 code.......'.yellow
5625
+ sleep(1)
5555
5626
  rescue
5556
5627
  begin
5557
5628
 
5558
- @driver.find_element(:xpath, '//*[@title="HTML 편집"]').click
5629
+ html_bb = @driver.find_element(:xpath, '//*[@title="HTML 편집"]')
5630
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5559
5631
  puts '-[√] HTML 코드 2 code.......'.yellow
5560
-
5632
+ sleep(1)
5633
+ @driver.find_element(:xpath, '//*[@title="HTML 편집"]').click
5561
5634
  rescue
5562
5635
  begin
5563
5636
 
5564
- @driver.find_element(:xpath, '//*[@id="html"]').click
5637
+ html_bb = @driver.find_element(:xpath, '//*[@id="html"]')
5638
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5565
5639
  puts '-[√] HTML 코드 3 code.......'.yellow
5640
+ sleep(1)
5641
+ @driver.find_element(:xpath, '//*[@id="html"]').click
5566
5642
  rescue
5567
5643
  begin
5568
5644
 
5569
- @driver.find_element(:xpath, '//*[@title="코드보기"]').click
5645
+ html_bb = @driver.find_element(:xpath, '//*[@title="코드보기"]')
5646
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5570
5647
  puts '-[√] HTML 코드 4 code.......'.yellow
5648
+ sleep(1)
5649
+ @driver.find_element(:xpath, '//*[@title="코드보기"]').click
5571
5650
  rescue
5572
5651
  begin
5573
5652
 
5574
- @driver.find_element(:xpath, '//*[@id="chk_html"]').click
5653
+ html_bb = @driver.find_element(:xpath, '//*[@id="chk_html"]')
5654
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5575
5655
  puts '-[√] HTML 코드 5 code.......'.yellow
5656
+ sleep(1)
5657
+ @driver.find_element(:xpath, '//*[@id="chk_html"]').click
5576
5658
  rescue
5577
5659
  begin
5578
5660
 
5579
- @driver.find_element(:xpath, '//*[@id="kboard_content-html"]').click
5661
+ html_bb = @driver.find_element(:xpath, '//*[@id="kboard_content-html"]')
5662
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5580
5663
  puts '-[√] HTML 코드 6 code.......'.yellow
5664
+ sleep(1)
5665
+ @driver.find_element(:xpath, '//*[@id="kboard_content-html"]').click
5581
5666
  rescue
5582
5667
  begin
5583
5668
 
5584
- @driver.find_element(:xpath, '//*[@alt="코드"]').click
5669
+ html_bb = @driver.find_element(:xpath, '//*[@alt="코드"]')
5670
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5585
5671
  puts '-[√] HTML 코드 7 code.......'.yellow
5672
+ sleep(1)
5673
+ @driver.find_element(:xpath, '//*[@alt="코드"]').click
5586
5674
  rescue
5587
5675
  begin
5588
5676
 
5589
- @driver.find_element(:xpath, '//*[@title="HTML 편집기"]').click
5677
+ html_bb = @driver.find_element(:xpath, '//*[@title="HTML 편집기"]')
5678
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5590
5679
  puts '-[√] HTML 코드 8 code.......'.yellow
5680
+ sleep(1)
5681
+ @driver.find_element(:xpath, '//*[@title="HTML 편집기"]').click
5591
5682
  rescue
5592
5683
  begin
5593
5684
 
5594
- @driver.find_element(:xpath, '//*[@name="tag"]').click
5685
+ html_bb = @driver.find_element(:xpath, '//*[@name="tag"]')
5686
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5595
5687
  puts '-[√] HTML 코드 9 code.......'.yellow
5688
+ sleep(1)
5689
+ @driver.find_element(:xpath, '//*[@name="tag"]').click
5596
5690
  rescue
5597
5691
  begin
5598
- @driver.find_element(:xpath, '//*[@name="html"]').click
5692
+ html_bb = @driver.find_element(:xpath, '//*[@name="html"]')
5693
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5599
5694
  puts '-[√] HTML 코드 10 code.......'.yellow
5600
5695
  sleep(1.5)
5696
+ @driver.find_element(:xpath, '//*[@name="html"]').click
5601
5697
 
5602
5698
  rescue
5603
5699
  begin
5604
5700
 
5605
- @driver.find_element(:xpath, '//*[@id="html"]').click
5701
+ html_bb = @driver.find_element(:xpath, '//*[@id="html"]')
5702
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5606
5703
  puts '-[√] HTML 코드 12 code.......'.yellow
5607
5704
  sleep(1)
5705
+ @driver.find_element(:xpath, '//*[@id="html"]').click
5608
5706
  rescue
5609
5707
  begin
5610
5708
 
5611
- @driver.find_element(:xpath, '//*[@data-wp-editor-id="kboard_content"]').click
5709
+ html_bb = @driver.find_element(:xpath, '//*[@data-wp-editor-id="kboard_content"]')
5710
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5612
5711
  puts '-[√] HTML 코드 13 code.......'.yellow
5613
5712
  sleep(1)
5713
+ @driver.find_element(:xpath, '//*[@data-wp-editor-id="kboard_content"]').click
5614
5714
  rescue
5615
5715
  begin
5616
5716
 
5617
- @driver.find_element(:xpath, '//*[@title="소스"]').click
5717
+ html_bb = @driver.find_element(:xpath, '//*[@title="소스"]')
5718
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5618
5719
  puts '-[√] HTML 코드 14 code.......'.yellow
5619
5720
  sleep(1)
5721
+ @driver.find_element(:xpath, '//*[@title="소스"]').click
5620
5722
  rescue
5621
5723
  begin
5622
5724
 
5623
- @driver.find_element(:xpath, '//*[@class="note-btn btn-codeview note-codeview-keep active"]').click
5725
+ html_bb = @driver.find_element(:xpath, '//*[@class="note-btn btn-codeview note-codeview-keep active"]')
5726
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5624
5727
  puts '-[√] HTML 코드 15 code.......'.yellow
5625
5728
  sleep(1)
5729
+ @driver.find_element(:xpath, '//*[@class="note-btn btn-codeview note-codeview-keep active"]').click
5626
5730
  rescue
5627
5731
  begin
5628
5732
 
5629
- @driver.find_element(:xpath, '//*[@for="html"]').click
5733
+ html_bb = @driver.find_element(:xpath, '//*[@for="html"]')
5734
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5630
5735
  puts '-[√] HTML 코드 16 code.......'.yellow
5631
5736
  sleep(1)
5737
+ @driver.find_element(:xpath, '//*[@for="html"]').click
5632
5738
  rescue
5633
5739
  begin
5634
5740
 
5635
- @driver.find_element(:xpath, '//*[@onclick="html_auto_br(this);"]').click
5741
+ html_bb = @driver.find_element(:xpath, '//*[@onclick="html_auto_br(this);"]')
5742
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5636
5743
  puts '-[√] HTML 코드 17 code.......'.yellow
5637
5744
  sleep(1)
5745
+ @driver.find_element(:xpath, '//*[@onclick="html_auto_br(this);"]').click
5638
5746
  rescue
5639
5747
  begin
5640
5748
 
5641
- @driver.find_element(:xpath, '//*[@data-title="코드보기"]').click
5749
+ html_bb = @driver.find_element(:xpath, '//*[@data-title="코드보기"]')
5750
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5642
5751
  puts '-[√] HTML 코드 18 code.......'.yellow
5643
5752
  sleep(1)
5753
+ @driver.find_element(:xpath, '//*[@data-title="코드보기"]').click
5644
5754
  rescue
5645
5755
  begin
5646
5756
 
5647
- @driver.find_element(:xpath, '//*[@title="에디터 타입"]').click
5757
+ html_bb = @driver.find_element(:xpath, '//*[@title="에디터 타입"]')
5758
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5648
5759
  puts '-[√] HTML 코드 19 code.......'.yellow
5649
5760
  sleep(1)
5761
+ @driver.find_element(:xpath, '//*[@title="에디터 타입"]').click
5650
5762
  rescue
5651
5763
  begin
5652
5764
 
5653
- @driver.find_element(:xpath, '//*[@aria-label="코드 보기"]').click
5765
+ html_bb = @driver.find_element(:xpath, '//*[@aria-label="코드 보기"]')
5766
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5654
5767
  puts '-[√] HTML 코드 20 code.......'.yellow
5655
5768
  sleep(1)
5769
+ @driver.find_element(:xpath, '//*[@aria-label="코드 보기"]').click
5656
5770
  rescue
5657
5771
  begin
5658
5772
 
5659
- @driver.find_element(:xpath, '//*[@id="fwrite"]/ul/li[2]/div/div/div').click
5773
+ html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/ul/li[2]/div/div/div').click
5774
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5660
5775
  puts '-[√] HTML 코드 21 code.......'.yellow
5661
5776
  sleep(1)
5777
+ @driver.find_element(:xpath, '//*[@id="fwrite"]/ul/li[2]/div/div/div')
5662
5778
  rescue
5663
5779
  begin
5664
5780
 
5665
- @driver.find_element(:xpath, '//*[@data-cke-tooltip-text="소스"]').click
5781
+ html_bb = @driver.find_element(:xpath, '//*[@data-cke-tooltip-text="소스"]')
5782
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5666
5783
  puts '-[√] HTML 코드 22 code.......'.yellow
5667
5784
  sleep(1)
5785
+ @driver.find_element(:xpath, '//*[@data-cke-tooltip-text="소스"]').click
5668
5786
  rescue
5669
5787
  begin
5788
+ html_bb = @driver.find_element(:xpath, '//*[@id="moreMisc-1"]')
5789
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5790
+ sleep(1)
5670
5791
  @driver.find_element(:xpath, '//*[@id="moreMisc-1"]').click
5671
5792
  sleep(1)
5672
5793
  @driver.find_element(:xpath, '//*[@id="html-1"]').click
@@ -5674,33 +5795,43 @@ begin
5674
5795
  rescue
5675
5796
  begin
5676
5797
 
5677
- @driver.find_element(:xpath, '//*[@id="html-1"]').click
5798
+ html_bb = @driver.find_element(:xpath, '//*[@id="html-1"]')
5799
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5678
5800
  puts '-[√] HTML 코드 24 code.......'.yellow
5679
5801
  sleep(1)
5802
+ @driver.find_element(:xpath, '//*[@id="html-1"]').click
5680
5803
  rescue
5681
5804
  begin
5682
5805
 
5683
- @driver.find_element(:xpath, '//*[@class="fas fa-code"]').click
5806
+ html_bb = @driver.find_element(:xpath, '//*[@class="fas fa-code"]')
5807
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5684
5808
  puts '-[√] HTML 코드 25 code.......'.yellow
5685
5809
  sleep(1)
5810
+ @driver.find_element(:xpath, '//*[@class="fas fa-code"]').click
5686
5811
  rescue
5687
5812
  begin
5688
5813
 
5689
- @driver.find_element(:xpath, '//*[@title="HTML모드"]').click
5814
+ html_bb = @driver.find_element(:xpath, '//*[@title="HTML모드"]')
5815
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5690
5816
  puts '-[√] HTML 코드 26 code.......'.yellow
5691
5817
  sleep(1)
5818
+ @driver.find_element(:xpath, '//*[@title="HTML모드"]').click
5692
5819
  rescue
5693
5820
  begin
5694
5821
 
5695
- @driver.find_element(:xpath, '//*[@id="wr_content-html"]').click
5822
+ html_bb = @driver.find_element(:xpath, '//*[@id="wr_content-html"]')
5823
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5696
5824
  puts '-[√] HTML 코드 27 code.......'.yellow
5697
5825
  sleep(1)
5826
+ @driver.find_element(:xpath, '//*[@id="wr_content-html"]').click
5698
5827
  rescue
5699
5828
  begin
5700
5829
 
5701
- @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
5830
+ html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label')
5831
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
5702
5832
  puts '-[√] HTML 코드 28 code.......'.yellow
5703
5833
  sleep(1)
5834
+ @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
5704
5835
  rescue
5705
5836
 
5706
5837
  end
@@ -8006,151 +8137,170 @@ sleep(1)
8006
8137
  puts '-[√] 내용 등록 버튼 탐색 시작.......'.yellow
8007
8138
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 ▼▼▼▼▼▼▼──────────────────────────────#######
8008
8139
  begin
8009
- @driver.find_element(:xpath, '//*[@value="등록"]').send_keys()
8010
- sleep(2)
8140
+ ss_button = @driver.find_element(:xpath, '//*[@value="등록"]')
8141
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8142
+ sleep(1)
8011
8143
 
8012
8144
  @driver.find_element(:xpath, '//*[@value="등록"]').click
8013
8145
  puts '-[√] 등록을 1번 코드로 시도하였습니다.......'.magenta
8014
8146
  sleep(5)
8015
8147
  rescue
8016
8148
  begin
8017
- @driver.find_element(:xpath, '//*[@alt="등록"]').send_keys()
8018
- sleep(2)
8149
+ ss_button = @driver.find_element(:xpath, '//*[@alt="등록"]')
8150
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8151
+ sleep(1)
8019
8152
 
8020
8153
  @driver.find_element(:xpath, '//*[@alt="등록"]').click
8021
8154
  puts '-[√] 등록을 2번 코드로 시도하였습니다.......'.magenta
8022
8155
  sleep(5)
8023
8156
  rescue
8024
8157
  begin
8025
- @driver.find_element(:xpath, '//*[@value="작성완료"]').send_keys()
8026
- sleep(2)
8158
+ ss_button = @driver.find_element(:xpath, '//*[@value="작성완료"]')
8159
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8160
+ sleep(1)
8027
8161
 
8028
8162
  @driver.find_element(:xpath, '//*[@value="작성완료"]').click
8029
8163
  puts '-[√] 등록을 3번 코드로 시도하였습니다.......'.magenta
8030
8164
  sleep(5)
8031
8165
  rescue
8032
8166
  begin
8033
- @driver.find_element(:xpath, '//*[@id="btn_submit"]').send_keys()
8034
- sleep(2)
8167
+ ss_button = @driver.find_element(:xpath, '//*[@id="btn_submit"]')
8168
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8169
+ sleep(1)
8035
8170
  @driver.find_element(:xpath, '//*[@id="btn_submit"]').click
8036
8171
  puts '-[√] 등록을 4번 코드로 시도하였습니다.......'.magenta
8037
8172
  sleep(5)
8038
8173
  rescue
8039
8174
  begin
8040
- @driver.find_element(:xpath, '//*[@class="btn btn-success btn-sm"]').send_keys()
8041
- sleep(2)
8175
+ ss_button = @driver.find_element(:xpath, '//*[@class="btn btn-success btn-sm"]')
8176
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8177
+ sleep(1)
8042
8178
 
8043
8179
  @driver.find_element(:xpath, '//*[@class="btn btn-success btn-sm"]').click
8044
8180
  puts '-[√] 등록을 5번 코드로 시도하였습니다.......'.magenta
8045
8181
  sleep(5)
8046
8182
  rescue
8047
8183
  begin
8048
- @driver.find_element(:xpath, '//*[@class="btn btn-default btn-send-write"]').send_keys()
8049
- sleep(2)
8184
+ ss_button = @driver.find_element(:xpath, '//*[@class="btn btn-default btn-send-write"]')
8185
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8186
+ sleep(1)
8050
8187
 
8051
8188
  @driver.find_element(:xpath, '//*[@class="btn btn-default btn-send-write"]').click
8052
8189
  puts '-[√] 등록을 6번 코드로 시도하였습니다.......'.magenta
8053
8190
  sleep(5)
8054
8191
  rescue
8055
8192
  begin
8056
- @driver.find_element(:xpath, '//*[@title="확인"]').send_keys()
8057
- sleep(2)
8193
+ ss_button = @driver.find_element(:xpath, '//*[@title="확인"]')
8194
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8195
+ sleep(1)
8058
8196
 
8059
8197
  @driver.find_element(:xpath, '//*[@title="확인"]').click
8060
8198
  puts '-[√] 등록을 7번 코드로 시도하였습니다.......'.magenta
8061
8199
  sleep(5)
8062
8200
  rescue
8063
8201
  begin
8064
- @driver.find_element(:xpath, '//*[@id="btnSubmit"]').send_keys()
8065
- sleep(2)
8202
+ ss_button = @driver.find_element(:xpath, '//*[@id="btnSubmit"]')
8203
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8204
+ sleep(1)
8066
8205
 
8067
8206
  @driver.find_element(:xpath, '//*[@id="btnSubmit"]').click
8068
8207
  puts '-[√] 등록을 8번 코드로 시도하였습니다.......'.magenta
8069
8208
  sleep(5)
8070
8209
  rescue
8071
8210
  begin
8072
- @driver.find_element(:xpath, '//*[@src="images/board8_input.gif"]').send_keys()
8073
- sleep(2)
8211
+ ss_button = @driver.find_element(:xpath, '//*[@src="images/board8_input.gif"]')
8212
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8213
+ sleep(1)
8074
8214
 
8075
8215
  @driver.find_element(:xpath, '//*[@src="images/board8_input.gif"]').click
8076
8216
  puts '-[√] 등록을 9번 코드로 시도하였습니다.......'.magenta
8077
8217
  sleep(5)
8078
8218
  rescue
8079
8219
  begin
8080
- @driver.find_element(:xpath, '//*[@align="absmiddle"]').send_keys()
8081
- sleep(2)
8220
+ ss_button = @driver.find_element(:xpath, '//*[@align="absmiddle"]')
8221
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8222
+ sleep(1)
8082
8223
 
8083
8224
  @driver.find_element(:xpath, '//*[@align="absmiddle"]').click
8084
8225
  puts '-[√] 등록을 10번 코드로 시도하였습니다.......'.magenta
8085
8226
  sleep(5)
8086
8227
  rescue
8087
8228
  begin
8088
- @driver.find_element(:partial_link_text, '작성완료').send_keys()
8089
- sleep(2)
8229
+ ss_button = @driver.find_element(:partial_link_text, '작성완료')
8230
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8231
+ sleep(1)
8090
8232
 
8091
8233
  @driver.find_element(:partial_link_text, '작성완료').click#요소같고 텍스트가 다를때 텍스트로 타겟
8092
8234
  puts '-[√] 등록을 11번 코드로 시도하였습니다.......'.magenta
8093
8235
  sleep(5)
8094
8236
  rescue
8095
8237
  begin
8096
- @driver.find_element(:xpath, '//*[@class="_save_post save_post btn"]').send_keys()
8097
- sleep(2)
8238
+ ss_button = @driver.find_element(:xpath, '//*[@class="_save_post save_post btn"]')
8239
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8240
+ sleep(1)
8098
8241
 
8099
8242
  @driver.find_element(:xpath, '//*[@class="_save_post save_post btn"]').click
8100
8243
  puts '-[√] 등록을 12번 코드로 시도하였습니다.......'.magenta
8101
8244
  sleep(5)
8102
8245
  rescue
8103
8246
  begin
8104
- @driver.find_element(:xpath, '//*[@id="main_btn_box"]/button').send_keys()
8105
- sleep(2)
8247
+ ss_button = @driver.find_element(:xpath, '//*[@id="main_btn_box"]/button')
8248
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8249
+ sleep(1)
8106
8250
 
8107
8251
  @driver.find_element(:xpath, '//*[@id="main_btn_box"]/button').click
8108
8252
  puts '-[√] 등록을 13번 코드로 시도하였습니다.......'.magenta
8109
8253
  sleep(5)
8110
8254
  rescue
8111
8255
  begin
8112
- @driver.find_element(:xpath, '//*[@id="bttnComplete1"]').send_keys()
8113
- sleep(2)
8256
+ ss_button = @driver.find_element(:xpath, '//*[@id="bttnComplete1"]')
8257
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8258
+ sleep(1)
8114
8259
 
8115
8260
  @driver.find_element(:xpath, '//*[@id="bttnComplete1"]').click
8116
8261
  puts '-[√] 등록을 14번 코드로 시도하였습니다.......'.magenta
8117
8262
  sleep(5)
8118
8263
  rescue
8119
8264
  begin
8120
- @driver.find_element(:xpath, '//*[@id="bd-write-btns"]/button').send_keys()
8121
- sleep(2)
8265
+ ss_button = @driver.find_element(:xpath, '//*[@id="bd-write-btns"]/button')
8266
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8267
+ sleep(1)
8122
8268
 
8123
8269
  @driver.find_element(:xpath, '//*[@id="bd-write-btns"]/button').click
8124
8270
  puts '-[√] 등록을 15번 코드로 시도하였습니다.......'.magenta
8125
8271
  sleep(5)
8126
8272
  rescue
8127
8273
  begin
8128
- @driver.find_element(:xpath, '//*[@id="com_btn"]').send_keys()
8129
- sleep(2)
8274
+ ss_button = @driver.find_element(:xpath, '//*[@id="com_btn"]')
8275
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8276
+ sleep(1)
8130
8277
 
8131
8278
  @driver.find_element(:xpath, '//*[@id="com_btn"]').click
8132
8279
  puts '-[√] 등록을 16번 코드로 시도하였습니다.......'.magenta
8133
8280
  sleep(5)
8134
8281
  rescue
8135
8282
  begin
8136
- @driver.find_element(:xpath, '//*[@class="submit"]').send_keys()
8137
- sleep(2)
8283
+ ss_button = @driver.find_element(:xpath, '//*[@class="submit"]')
8284
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8285
+ sleep(1)
8138
8286
 
8139
8287
  @driver.find_element(:xpath, '//*[@class="submit"]').click
8140
8288
  puts '-[√] 등록을 17번 코드로 시도하였습니다.......'.magenta
8141
8289
  sleep(5)
8142
8290
  rescue
8143
8291
  begin
8144
- @driver.find_element(:xpath, '//*[@id="savePostInBoard"]').send_keys()
8145
- sleep(2)
8292
+ ss_button = @driver.find_element(:xpath, '//*[@id="savePostInBoard"]')
8293
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8294
+ sleep(1)
8146
8295
 
8147
8296
  @driver.find_element(:xpath, '//*[@id="savePostInBoard"]').click
8148
8297
  puts '-[√] 등록을 18번 코드로 시도하였습니다.......'.magenta
8149
8298
  sleep(5)
8150
8299
  rescue
8151
8300
  begin
8152
- @driver.find_element(:xpath, '//*[@form="write"]').send_keys()
8153
- sleep(2)
8301
+ ss_button = @driver.find_element(:xpath, '//*[@form="write"]')
8302
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8303
+ sleep(1)
8154
8304
 
8155
8305
  @driver.find_element(:xpath, '//*[@form="write"]').click
8156
8306
  puts '-[√] 등록을 19번 코드로 시도하였습니다.......'.magenta
@@ -8158,8 +8308,9 @@ rescue
8158
8308
 
8159
8309
  rescue
8160
8310
  begin
8161
- @driver.find_element(:partial_link_text, '저장하기').send_keys()
8162
- sleep(2)
8311
+ ss_button = @driver.find_element(:partial_link_text, '저장하기')
8312
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8313
+ sleep(1)
8163
8314
 
8164
8315
  @driver.find_element(:partial_link_text, '저장하기').click #요소같고 텍스트가 다를때 텍스트로 타겟
8165
8316
  puts '-[√] 등록을 20번 코드로 시도하였습니다.......'.magenta
@@ -8167,8 +8318,9 @@ rescue
8167
8318
 
8168
8319
  rescue
8169
8320
  begin
8170
- @driver.find_element(:xpath, '//*[@id="boardWriteForm"]/div/div[3]/a[2]').send_keys()
8171
- sleep(2)
8321
+ ss_button = @driver.find_element(:xpath, '//*[@id="boardWriteForm"]/div/div[3]/a[2]')
8322
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8323
+ sleep(1)
8172
8324
 
8173
8325
  @driver.find_element(:xpath, '//*[@id="boardWriteForm"]/div/div[3]/a[2]').click
8174
8326
  puts '-[√] 등록을 21시도하였습니다.......'.magenta
@@ -8176,9 +8328,9 @@ rescue
8176
8328
 
8177
8329
  rescue
8178
8330
  begin
8179
- el_btn = @driver.find_element(:xpath, '//*[@class="btnWrite"]')
8180
- @driver.action.move_to(el_btn).perform
8181
- sleep(2)
8331
+ ss_button = @driver.find_element(:xpath, '//*[@class="btnWrite"]')
8332
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8333
+ sleep(1)
8182
8334
 
8183
8335
  @driver.find_element(:xpath, '//*[@class="btnWrite"]').click
8184
8336
  puts '-[√] 등록을 22시도하였습니다.......'.magenta
@@ -8186,43 +8338,47 @@ rescue
8186
8338
 
8187
8339
  rescue
8188
8340
  begin
8189
- @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').send_keys()
8190
- sleep(2)
8341
+ ss_button = @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]')
8342
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8343
+ sleep(1)
8191
8344
 
8192
8345
  @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').click
8193
- puts '-[√] 등록을 24번 코드로 시도하였습니다.......'.magenta
8346
+ puts '-[√] 등록을 23번 코드로 시도하였습니다.......'.magenta
8194
8347
  sleep(5)
8195
8348
 
8196
8349
  rescue
8197
8350
  begin
8198
- @driver.find_element(:xpath, '//*[@type="submit"]').send_keys()
8199
- sleep(2)
8351
+ ss_button = @driver.find_element(:xpath, '//*[@type="submit"]')
8352
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8353
+ sleep(1)
8200
8354
 
8201
8355
  @driver.find_element(:xpath, '//*[@type="submit"]').click
8202
- puts '-[√] 등록을 23번 코드로 시도하였습니다.......'.magenta
8356
+ puts '-[√] 등록을 24번 코드로 시도하였습니다.......'.magenta
8203
8357
  sleep(5)
8204
8358
 
8205
8359
  rescue
8206
8360
  begin
8207
- @driver.find_element(:xpath, '//*[@class="button-agree"]').send_keys()
8208
- sleep(2)
8361
+ ss_button = @driver.find_element(:xpath, '//*[@class="button-agree"]')
8362
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8363
+ sleep(1)
8209
8364
 
8210
8365
  @driver.find_element(:xpath, '//*[@class="button-agree"]').click
8211
- puts '-[√] 등록을 23번 코드로 시도하였습니다.......'.magenta
8366
+ puts '-[√] 등록을 25번 코드로 시도하였습니다.......'.magenta
8212
8367
  sleep(5)
8213
8368
 
8214
8369
  rescue
8215
8370
  begin
8216
- @driver.find_element(:xpath, '//*[@class="btnSubmitFix sizeM"]').send_keys()
8217
- sleep(2)
8371
+ ss_button = @driver.find_element(:xpath, '//*[@class="btnSubmitFix sizeM"]')
8372
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
8373
+ sleep(1)
8218
8374
 
8219
8375
  @driver.find_element(:xpath, '//*[@class="btnSubmitFix sizeM"]').click
8220
- puts '-[√] 등록을 23번 코드로 시도하였습니다.......'.magenta
8376
+ puts '-[√] 등록을 26번 코드로 시도하였습니다.......'.magenta
8221
8377
  sleep(5)
8222
8378
 
8223
8379
  rescue
8224
-
8225
-
8380
+
8381
+
8226
8382
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
8227
8383
  begin
8228
8384
  puts '-[√] 등록 버튼 코드 탐색에 실패하였습니다.......'.magenta
@@ -8380,13 +8536,23 @@ rescue
8380
8536
  @driver.action.key_down(:enter).key_up(:enter).perform #엔터
8381
8537
  puts '-[√] 등록을 시도하였습니다.......'.magenta
8382
8538
  sleep(5)
8383
- rescue
8539
+
8540
+ rescue => e
8384
8541
  puts '-[√] 등록 실패.......'.red
8385
8542
  puts '-[√] 로딩 및 코드인식 실패등 기타 이유로 다음 게시판 작업으로 이동합니다.......'.red
8386
8543
  puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
8387
- @driver.close
8388
-
8389
- end
8544
+ @driver.window_handles.each do |handle|
8545
+ @driver.switch_to.window(handle)
8546
+ begin
8547
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
8548
+ @driver.close
8549
+ rescue Selenium::WebDriver::Error::WebDriverError => e
8550
+ puts "Failed to close tab: #{e.message}"
8551
+ end
8552
+ end
8553
+ return 0
8554
+ @driver.quit()
8555
+ end
8390
8556
 
8391
8557
  end
8392
8558
 
@@ -8491,22 +8657,39 @@ rescue
8491
8657
 
8492
8658
 
8493
8659
 
8494
- begin
8495
- @driver.close
8496
- rescue
8497
- end
8660
+
8661
+
8498
8662
 
8499
8663
  rescue => e
8500
8664
  puts '-[√] 글쓰기 페이지 접근 및 코드 탐색 ERROR 발생.......'.red
8501
- @driver.quit
8502
- end
8665
+ @driver.window_handles.each do |handle|
8666
+ @driver.switch_to.window(handle)
8667
+ begin
8668
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
8669
+ @driver.close
8670
+
8671
+ rescue Selenium::WebDriver::Error::WebDriverError => e
8672
+ puts "Failed to close tab: #{e.message}"
8673
+ end
8674
+ end
8675
+ return 0
8676
+ @driver.quit()
8677
+ end
8503
8678
  sleep(1)
8504
8679
  ########크롬드라이버 전체 닫기##########
8505
8680
  begin
8506
- system("taskkill /f /im chromedriver.exe /t")
8507
- puts "크롬드라이버 강제 종료 성공"
8508
- rescue StandardError => e
8509
- @driver.close
8681
+ @driver.window_handles.each do |handle|
8682
+ @driver.switch_to.window(handle)
8683
+ begin
8684
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
8685
+ @driver.close
8686
+
8687
+ rescue Selenium::WebDriver::Error::WebDriverError => e
8688
+ puts "Failed to close tab: #{e.message}"
8689
+ end
8690
+ end
8691
+ @driver.quit()
8692
+ rescue
8510
8693
  end
8511
8694
  ########크롬드라이버 전체 닫기##########
8512
8695
 
@@ -8520,6 +8703,8 @@ end
8520
8703
  end
8521
8704
 
8522
8705
 
8706
+
8707
+
8523
8708
  class Wordpress
8524
8709
  include Glimmer
8525
8710
 
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.30
4
+ version: 0.0.32
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-21 00:00:00.000000000 Z
11
+ date: 2025-02-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: mymin26@naver.com