posting_zon 3.87.799 → 3.89.799

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_zon.rb +275 -311
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d26b1f2f5ad9508a9d9197db47ed9d64a429cb70952c70f46982daf9478622e
4
- data.tar.gz: '082865361cfafe9401e6f660f11a3a4967a74445cab2fc84f7026c37d0c8c831'
3
+ metadata.gz: a609f187dea3248f7acd1a8627d632559369580e39afdbcfa3564dec059ad563
4
+ data.tar.gz: 38d310816a7cf5e7d765ab420ec1616c9992912a96f9bf2f4bf19c5ed9d16d4d
5
5
  SHA512:
6
- metadata.gz: 323432c111cf138f7d145142c600be7dbbd2d67cb23e7bf7a0a81eaa2db22392630069a9a53c440d0f82bf888577f2204b614d5e3d0e225e00019c0e37034cbc
7
- data.tar.gz: be9ab189d054bdaf61b27d740f30e1a8d9ccb0915bf302826282f22e7302f3b3d4f71efec83aa77cb518b78fc9bb803fd027081091bc815cdaa9f00dbea66395
6
+ metadata.gz: a3857a6c35f24828e3b55443ebb559e1f0365d64ff263e108a6afffcc2670c3828b007f7e0a5ca89762b6efa13b07d01cf25bd6213847e9bdab47c8fadf08ccb
7
+ data.tar.gz: 260b87a32dff67e261327918c4eb12ffb5eab0348c8895059aeb755e3fb7cf7a70af34059038d3a875a186414db24f7b6a4a3233fc1fcf5b335394c510a0a3e3
data/lib/posting_zon.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'glimmer-dsl-libui'
2
2
  require 'selenium-webdriver'
3
- require 'webdrivers'
3
+ #require 'webdrivers'
4
4
  require 'iconv'
5
5
  require 'nokogiri'
6
6
  require 'open-uri'
@@ -28,23 +28,6 @@ using Rainbow
28
28
 
29
29
  class Naver
30
30
  def initialize
31
-
32
- begin
33
- puts "크롬을 최신 상태로 업데이트 해주세요"
34
- puts "크롬 최신 상태가 아닐경우 오류가 발생될수있습니다."
35
- Webdrivers.cache_time = 86_400 # 하루로 설정 (기본값: 86_400초)
36
- Webdrivers.install_dir = "./" # 크롬드라이버를 수동으로 설치할 경로를 설정
37
- Webdrivers::Chromedriver.update
38
- puts "chromedriver 자동 다운로드 성공"
39
- rescue => e
40
- puts "chromedriver 자동 다운로드 실패: #{e.message}"
41
- puts "폴더내 크롬드라이버를 사용합니다."
42
- puts "크롬드라이버가 오래된 경우 오류 발생될 수 있으며, 만일 오류 발생시 아래 지침을 따라주세요."
43
- puts "1.크롬 업데이트 2.프로그램 폴더 내부에 ★tip★-시작시-크롬창이....파일을 열어 드라이버를 교체하세요."
44
- chromedriver_path = './chromedriver.exe' # 수동 경로를 인스턴스 변수로 설정
45
- Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
46
- end
47
-
48
31
  end
49
32
 
50
33
 
@@ -67,9 +50,20 @@ class Naver
67
50
  FileUtils.mkdir_p(board_cookie_dir) unless File.exist?(board_cookie_dir)
68
51
  if proxy == ''
69
52
  begin
53
+ begin
54
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
55
+ rescue => e
56
+ puts "chromedriver 버전 불일치!!"
57
+ puts "아래 지침을 따라주세요."
58
+ puts "1.프로그램 종료!"
59
+ puts "2.크롬 업데이트!"
60
+ puts "3.프로그램 폴더 내부에 ★tip★-시작시-크롬창이....파일 실행"
61
+ puts "4.안내된 방식으로 크롬 드라이버 교체"
62
+ puts "5.재 시작"
63
+ exit 1
64
+ end
70
65
  options = Selenium::WebDriver::Chrome::Options.new
71
66
  options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
72
-
73
67
  options.add_argument('--disable-sync') # Chrome 동기화 비활성화
74
68
  options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
75
69
  options.add_argument('--no-default-browser-check')
@@ -105,7 +99,18 @@ class Naver
105
99
  end
106
100
  else
107
101
  begin
108
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
102
+ begin
103
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
104
+ rescue => e
105
+ puts "chromedriver 버전 불일치!!"
106
+ puts "아래 지침을 따라주세요."
107
+ puts "1.프로그램 종료!"
108
+ puts "2.크롬 업데이트!"
109
+ puts "3.프로그램 폴더 내부에 ★tip★-시작시-크롬창이....파일 실행"
110
+ puts "4.안내된 방식으로 크롬 드라이버 교체"
111
+ puts "5.재 시작"
112
+ exit 1
113
+ end
109
114
  options = Selenium::WebDriver::Chrome::Options.new
110
115
  options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
111
116
 
@@ -144,7 +149,18 @@ class Naver
144
149
  puts e
145
150
  puts 'proxy error...'
146
151
  begin
147
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
152
+ begin
153
+ Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
154
+ rescue => e
155
+ puts "chromedriver 버전 불일치!!"
156
+ puts "아래 지침을 따라주세요."
157
+ puts "1.프로그램 종료!"
158
+ puts "2.크롬 업데이트!"
159
+ puts "3.프로그램 폴더 내부에 ★tip★-시작시-크롬창이....파일 실행"
160
+ puts "4.안내된 방식으로 크롬 드라이버 교체"
161
+ puts "5.재 시작"
162
+ exit 1
163
+ end
148
164
  options = Selenium::WebDriver::Chrome::Options.new
149
165
  options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
150
166
 
@@ -207,179 +223,127 @@ class Naver
207
223
 
208
224
  chrome_start(proxy, board_cookie_dir)
209
225
 
210
- # 열린 모든 탭 핸들 확인
211
- all_windows = @driver.window_handles
212
- #puts "현재 열려 있는 탭 수: #{all_windows.size}" # 열린 탭 수 출력
213
-
214
- # 원하는 URL
215
- target_url = "https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko"
216
-
217
- # 각 탭을 순회하면서
218
- all_windows.each do |window|
219
- @driver.switch_to.window(window)
220
- current_url = @driver.current_url
221
- #puts "탭 URL: #{current_url}" # 각 탭 URL 출력
226
+ # 열린 모든 탭 핸들 확인
227
+ all_windows = @driver.window_handles
228
+ #puts "현재 열려 있는 탭 수: #{all_windows.size}" # 열린 탭 수 출력
229
+
230
+ # 원하는 URL
231
+ target_url = "https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko"
232
+
233
+ # 각 탭을 순회하면서
234
+ all_windows.each do |window|
235
+ @driver.switch_to.window(window)
236
+ current_url = @driver.current_url
237
+ #puts "탭 URL: #{current_url}" # 각 탭 URL 출력
222
238
 
223
- # 원하는 URL이 아니면 탭을 닫기
224
- if current_url != target_url
225
- begin
226
- @driver.close # 다른 탭을 닫기
227
- rescue Selenium::WebDriver::Error::WebDriverError => e
228
- #puts "탭을 닫는 데 오류 발생: #{e.message}"
229
- end
230
- end
231
- end
239
+ # 원하는 URL이 아니면 탭을 닫기
240
+ if current_url != target_url
241
+ begin
242
+ @driver.close # 다른 탭을 닫기
243
+ rescue Selenium::WebDriver::Error::WebDriverError => e
244
+ #puts "탭을 닫는 데 오류 발생: #{e.message}"
245
+ end
246
+ end
247
+ end
232
248
 
233
- # 남아 있는 탭으로 전환
234
- all_windows = @driver.window_handles # 남은 탭 리스트 갱신
235
- if all_windows.size > 0
236
- @driver.switch_to.window(all_windows.first) # 남아 있는 첫 번째 탭으로 전환
237
- else
238
- #puts "남은 탭이 없습니다."
239
- end
249
+ # 남아 있는 탭으로 전환
250
+ all_windows = @driver.window_handles # 남은 탭 리스트 갱신
251
+ if all_windows.size > 0
252
+ @driver.switch_to.window(all_windows.first) # 남아 있는 첫 번째 탭으로 전환
253
+ else
254
+ #puts "남은 탭이 없습니다."
255
+ end
240
256
 
241
257
 
242
258
 
243
259
 
244
- sleep(1)
245
- begin
260
+ sleep(1)
261
+ begin
246
262
  wait = Selenium::WebDriver::Wait.new(:timeout => 3)
247
263
  wait.until { @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="ajZLRd"]') } #추가 되어 있음
248
264
  check_cookie_login = 1
249
265
  puts'[Step.01] CAPTCHA 세션 및 브라우저 설정 완료 상태 확인!!.......'.yellow
250
- rescue
251
- begin
252
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
253
- wait.until { @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="wQO0od"]') } #추가 안되어 있음
254
- sleep(1.5)
255
- @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="wQO0od"]').click
256
- puts'[Step.01] CAPTCHA 세션 연결 없음!! 브라우저 필요 설정 미 완료 상태!!.......'.red
257
- puts'[Step.02] CAPTCHA 세션 연결 및 브라우저 필요 설정 진행 시작!!.......'.red
258
- sleep(1.5)
259
- shell = WIN32OLE.new('WScript.Shell')
260
- shell.AppActivate("Captcha Solver: Auto Recognition and Bypass")
261
- shell.AppActivate("Captcha Solver: Auto Recognition and Bypass")
262
- sleep(1)
263
- shell.SendKeys("{TAB}")
264
- sleep(0.5)
265
- shell.SendKeys("{ENTER}")
266
-
267
- check_cookie_login = 0
268
- sleep(1)
269
- rescue
270
- @driver.quit
271
- return 0
272
- end
273
- end
266
+ rescue
267
+ begin
268
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
269
+ wait.until { @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="wQO0od"]') } #추가 안되어 있음
270
+ sleep(1.5)
271
+ @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="wQO0od"]').click
272
+ puts'[Step.01] CAPTCHA 세션 연결 없음!! 브라우저 필요 설정 미 완료 상태!!.......'.red
273
+ puts'[Step.02] CAPTCHA 세션 연결 및 브라우저 필요 설정 진행 시작!!.......'.red
274
+ sleep(1.5)
275
+ shell = WIN32OLE.new('WScript.Shell')
276
+ shell.AppActivate("Captcha Solver: Auto Recognition and Bypass")
277
+ shell.AppActivate("Captcha Solver: Auto Recognition and Bypass")
278
+ sleep(1)
279
+ shell.SendKeys("{TAB}")
280
+ sleep(0.5)
281
+ shell.SendKeys("{ENTER}")
282
+
283
+ check_cookie_login = 0
284
+ sleep(1)
285
+ rescue
286
+ @driver.quit
287
+ return 0
288
+ end
289
+ end
274
290
 
275
- if check_cookie_login == 0
291
+ if check_cookie_login == 0
276
292
 
277
- begin
278
-
279
- begin
280
- # 최대 20초 동안 확장 프로그램 탭이 열릴 때까지 대기
281
- extension_url = 'chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html'
282
- max_wait_time = 20
283
- waited = 0
284
- found = false
285
-
286
- while waited < max_wait_time
287
- all_windows = @driver.window_handles
288
- all_windows.each do |window|
289
- @driver.switch_to.window(window)
290
- current_url = @driver.current_url
291
- if current_url.include?(extension_url)
292
- found = true
293
- break
294
- end
295
- end
296
- break if found
297
-
298
- sleep(3)
299
- waited += 1
300
- end
301
-
302
- if found
303
- # 확장 프로그램 탭을 제외한 나머지 탭 닫기
304
- all_windows = @driver.window_handles
305
- all_windows.each do |window|
306
- @driver.switch_to.window(window)
307
- current_url = @driver.current_url
308
- if !current_url.include?(extension_url)
309
- sleep(2)
310
- @driver.close
311
- sleep(2)
312
- end
313
- end
314
-
315
- # 확장 프로그램 탭으로 전환
316
- remaining_windows = @driver.window_handles
317
- if remaining_windows.size > 0
318
- @driver.switch_to.window(remaining_windows.first)
319
- end
320
- else
321
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
322
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
323
- end
324
-
325
- rescue => e
326
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
327
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
328
- @driver.quit if @driver
329
- end
330
-
331
-
332
-
333
-
334
-
335
- begin
293
+ begin
294
+
336
295
  @driver.get('chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html')
337
- sleep(1)
338
- # 요소 찾기 타임아웃을 10초로 설정
339
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
340
- #요소가 나타날 때까지 60초 동안 기다립니다.
341
- wait.until { @driver.find_element(:xpath, '/html/body/div/div[1]/table/tbody/tr[1]/td[2]/input') }
342
- @driver.find_element(:xpath, '/html/body/div/div[1]/table/tbody/tr[1]/td[2]/input').click
343
- sleep(1)
344
- Clipboard.copy(captcha_key)
345
- @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
346
- sleep(1)
347
- @driver.find_element(:xpath, '//*[@id="connect"]').click
348
- sleep(1)
296
+ sleep(5)
297
+
298
+ begin
299
+ @driver.get('chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html')
300
+ sleep(1)
301
+ # 요소 찾기 타임아웃을 10초로 설정
302
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
303
+ #요소가 나타날 때까지 60초 동안 기다립니다.
304
+ wait.until { @driver.find_element(:xpath, '/html/body/div/div[1]/table/tbody/tr[1]/td[2]/input') }
305
+ @driver.find_element(:xpath, '/html/body/div/div[1]/table/tbody/tr[1]/td[2]/input').click
306
+ sleep(1)
307
+ Clipboard.copy(captcha_key)
308
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
309
+ sleep(1)
310
+ @driver.find_element(:xpath, '//*[@id="connect"]').click
311
+ sleep(1)
349
312
 
350
- begin
351
- wait = Selenium::WebDriver::Wait.new(:timeout => 10)
352
- wait.until do
353
- begin
354
- alert = @driver.switch_to.alert
355
- alert.accept
356
- sleep(1)
357
- true
358
- rescue Selenium::WebDriver::Error::NoSuchAlertError
359
- false
360
- end
361
- end
362
- rescue Selenium::WebDriver::Error::TimeoutError
363
- @driver.find_element(:xpath, '//*[@id="connect"]').click
364
- begin
365
- wait = Selenium::WebDriver::Wait.new(:timeout => 10)
366
- wait.until do
367
- begin
368
- alert = @driver.switch_to.alert
369
- alert.accept
370
- sleep(1)
371
- true
372
- rescue Selenium::WebDriver::Error::NoSuchAlertError
373
- false
374
- end
375
- end
376
- rescue Selenium::WebDriver::Error::TimeoutError
377
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
378
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
379
- system('taskkill /F /IM chrome.exe')
380
- @driver.quit if @driver
381
- end
382
- end
313
+ begin
314
+ wait = Selenium::WebDriver::Wait.new(:timeout => 10)
315
+ wait.until do
316
+ begin
317
+ alert = @driver.switch_to.alert
318
+ alert.accept
319
+ sleep(1)
320
+ true
321
+ rescue Selenium::WebDriver::Error::NoSuchAlertError
322
+ false
323
+ end
324
+ end
325
+ rescue Selenium::WebDriver::Error::TimeoutError
326
+ @driver.find_element(:xpath, '//*[@id="connect"]').click
327
+ begin
328
+ wait = Selenium::WebDriver::Wait.new(:timeout => 10)
329
+ wait.until do
330
+ begin
331
+ alert = @driver.switch_to.alert
332
+ alert.accept
333
+ sleep(1)
334
+ true
335
+ rescue Selenium::WebDriver::Error::NoSuchAlertError
336
+ false
337
+ end
338
+ end
339
+ rescue Selenium::WebDriver::Error::TimeoutError
340
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
341
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
342
+ system('taskkill /F /IM chrome.exe')
343
+ @driver.quit if @driver
344
+ end
345
+ end
346
+
383
347
  puts '-[√] 브라우저 필요 설정 1차 시도.......'.green
384
348
  @driver.manage.window.maximize
385
349
  sleep(2)
@@ -415,64 +379,64 @@ class Naver
415
379
  key_stroke('enter')
416
380
  sleep(1)
417
381
 
418
- rescue
419
- begin
420
- sleep(1)
421
- @driver.get('chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html')
422
- sleep(1)
423
- # 요소 찾기 타임아웃을 10초로 설정
424
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
425
- #요소가 나타날 때까지 60초 동안 기다립니다.
426
- wait.until { @driver.find_element(:xpath, '//*[@name="apiKey"]') }
427
- @driver.find_element(:xpath, '//*[@name="apiKey"]').click
428
- sleep(1)
429
- begin
430
- @driver.find_element(:xpath, '//*[@name="apiKey"]').click
431
- rescue
432
- end
433
-
434
- Clipboard.copy(captcha_key)
435
- @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
436
- sleep(1)
437
- begin
438
- @driver.find_element(:xpath, '//*[@class="default-btn"]').click
439
- sleep(1)
440
-
441
- begin
442
- wait = Selenium::WebDriver::Wait.new(:timeout => 10)
443
- wait.until do
444
- begin
445
- alert = @driver.switch_to.alert
446
- alert.accept
447
- sleep(1)
448
- true
449
- rescue Selenium::WebDriver::Error::NoSuchAlertError
450
- false
451
- end
452
- end
453
- rescue Selenium::WebDriver::Error::TimeoutError
454
-
455
- @driver.find_element(:xpath, '//*[@class="default-btn"]').click
456
- begin
457
- wait = Selenium::WebDriver::Wait.new(:timeout => 10)
458
- wait.until do
459
- begin
460
- alert = @driver.switch_to.alert
461
- alert.accept
462
- sleep(1)
463
- true
464
- rescue Selenium::WebDriver::Error::NoSuchAlertError
465
- false
466
- end
467
- end
468
-
469
- rescue Selenium::WebDriver::Error::TimeoutError
470
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
471
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
472
- system('taskkill /F /IM chrome.exe')
473
- @driver.quit if @driver
474
- end
475
- end
382
+ rescue
383
+ begin
384
+ sleep(1)
385
+ @driver.get('chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html')
386
+ sleep(1)
387
+ # 요소 찾기 타임아웃을 10초로 설정
388
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
389
+ #요소가 나타날 때까지 60초 동안 기다립니다.
390
+ wait.until { @driver.find_element(:xpath, '//*[@name="apiKey"]') }
391
+ @driver.find_element(:xpath, '//*[@name="apiKey"]').click
392
+ sleep(1)
393
+ begin
394
+ @driver.find_element(:xpath, '//*[@name="apiKey"]').click
395
+ rescue
396
+ end
397
+
398
+ Clipboard.copy(captcha_key)
399
+ @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
400
+ sleep(1)
401
+ begin
402
+ @driver.find_element(:xpath, '//*[@class="default-btn"]').click
403
+ sleep(1)
404
+
405
+ begin
406
+ wait = Selenium::WebDriver::Wait.new(:timeout => 10)
407
+ wait.until do
408
+ begin
409
+ alert = @driver.switch_to.alert
410
+ alert.accept
411
+ sleep(1)
412
+ true
413
+ rescue Selenium::WebDriver::Error::NoSuchAlertError
414
+ false
415
+ end
416
+ end
417
+ rescue Selenium::WebDriver::Error::TimeoutError
418
+
419
+ @driver.find_element(:xpath, '//*[@class="default-btn"]').click
420
+ begin
421
+ wait = Selenium::WebDriver::Wait.new(:timeout => 10)
422
+ wait.until do
423
+ begin
424
+ alert = @driver.switch_to.alert
425
+ alert.accept
426
+ sleep(1)
427
+ true
428
+ rescue Selenium::WebDriver::Error::NoSuchAlertError
429
+ false
430
+ end
431
+ end
432
+
433
+ rescue Selenium::WebDriver::Error::TimeoutError
434
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
435
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
436
+ system('taskkill /F /IM chrome.exe')
437
+ @driver.quit if @driver
438
+ end
439
+ end
476
440
 
477
441
  puts '-[√] 브라우저 필요 설정 1차 시도.......'.green
478
442
  @driver.manage.window.maximize
@@ -509,88 +473,88 @@ class Naver
509
473
  key_stroke('enter')
510
474
  sleep(1)
511
475
 
512
- rescue => e
513
- @driver.window_handles.each do |handle|
514
- @driver.switch_to.window(handle)
515
- begin
516
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
517
- @driver.close
518
- rescue Selenium::WebDriver::Error::WebDriverError => e
519
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
520
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
521
- end
522
- end
523
- return 0
524
- @driver.quit
525
- end
526
-
527
-
528
- rescue => e
529
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
530
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
531
- @driver.window_handles.each do |handle|
532
- @driver.switch_to.window(handle)
533
- begin
534
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
535
- @driver.close
536
- rescue Selenium::WebDriver::Error::WebDriverError => e
537
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
538
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
539
- end
540
- end
541
- return 0
542
- @driver.quit
543
- end
544
-
545
- end
476
+ rescue => e
477
+ @driver.window_handles.each do |handle|
478
+ @driver.switch_to.window(handle)
479
+ begin
480
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
481
+ @driver.close
482
+ rescue Selenium::WebDriver::Error::WebDriverError => e
483
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
484
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
485
+ end
486
+ end
487
+ return 0
488
+ @driver.quit
489
+ end
490
+
491
+
492
+ rescue => e
493
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
494
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
495
+ @driver.window_handles.each do |handle|
496
+ @driver.switch_to.window(handle)
497
+ begin
498
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
499
+ @driver.close
500
+ rescue Selenium::WebDriver::Error::WebDriverError => e
501
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
502
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
503
+ end
504
+ end
505
+ return 0
506
+ @driver.quit
507
+ end
508
+
509
+ end
546
510
 
547
- rescue => e
548
- puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
549
- puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
550
- @driver.window_handles.each do |handle|
551
- @driver.switch_to.window(handle)
552
- begin
553
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
554
- @driver.close
555
- rescue Selenium::WebDriver::Error::WebDriverError => e
556
- puts "Failed to close tab: #{e.message}"
557
- end
558
- end
559
- @driver.quit
560
- return 0
561
- end
511
+ rescue => e
512
+ puts "초기 작업 브라우저가 완벽하게 세팅 되지 않았습니다.".red
513
+ puts "C드라이브에서 scraping_cookie 폴더 삭제 후 다시 시작해주세요.".red
514
+ @driver.window_handles.each do |handle|
515
+ @driver.switch_to.window(handle)
516
+ begin
517
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
518
+ @driver.close
519
+ rescue Selenium::WebDriver::Error::WebDriverError => e
520
+ puts "Failed to close tab: #{e.message}"
521
+ end
522
+ end
523
+ @driver.quit
524
+ return 0
525
+ end
562
526
 
563
527
 
564
528
 
565
- else
566
- end
529
+ else
530
+ end
567
531
 
568
- begin
532
+ begin
569
533
 
570
534
 
571
535
 
572
- @driver.get('https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko')
573
- sleep(1)
574
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
575
- #요소가 나타날 때까지 3초 동안 기다립니다.
576
- wait.until { @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="ajZLRd"]') } #추가 되어 있음
577
- sleep(1)
578
- @driver.manage.window.maximize
536
+ @driver.get('https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko')
537
+ sleep(1)
538
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
539
+ #요소가 나타날 때까지 3초 동안 기다립니다.
540
+ wait.until { @driver.find_element(xpath: '//section[@class="lwrbTd"]//button[@jsname="ajZLRd"]') } #추가 되어 있음
541
+ sleep(1)
542
+ @driver.manage.window.maximize
579
543
 
580
- rescue => e
581
- puts '-[√] 연결 실패.......'.red
582
- @driver.window_handles.each do |handle|
583
- @driver.switch_to.window(handle)
584
- begin
585
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
586
- @driver.close
587
- rescue Selenium::WebDriver::Error::WebDriverError => e
588
- puts "Failed to close tab: #{e.message}"
589
- end
590
- end
591
- @driver.quit
592
- return 0
593
- end
544
+ rescue => e
545
+ puts '-[√] 연결 실패.......'.red
546
+ @driver.window_handles.each do |handle|
547
+ @driver.switch_to.window(handle)
548
+ begin
549
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
550
+ @driver.close
551
+ rescue Selenium::WebDriver::Error::WebDriverError => e
552
+ puts "Failed to close tab: #{e.message}"
553
+ end
554
+ end
555
+ @driver.quit
556
+ return 0
557
+ end
594
558
  end
595
559
 
596
560
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.87.799
4
+ version: 3.89.799
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-09 00:00:00.000000000 Z
10
+ date: 2025-05-13 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: posting app
13
13
  email: mymin26@naver.com