cafe_basics_duo 0.0.57 → 0.0.59
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/cafe_basics_duo.rb +39 -14
- 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: 48a4fcf4afe0766a0f4b8bf80594985de388d7b9f9fe99c015c95c1c865974c0
|
4
|
+
data.tar.gz: 3fb925c6335aa708306b9900ee13b2063f64b8524f49546f36f5c220bd2ac5c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a856706d5ededb26c6d6c98228e60f48ed6d926a5056ade6db7b2ff4d977307b1e86d382b09f1fa8688b0bfb9f9401677b31329614f32a2a00e0ec5cb943400f
|
7
|
+
data.tar.gz: 00c5390f26a67158a142226473cb9aa174561996959ffd0997031a2f7ab0572128611295bb10ade085edadae783d0a62afc4e3e4e838395c8fe337fed397b929
|
data/lib/cafe_basics_duo.rb
CHANGED
@@ -246,9 +246,13 @@ class Naver
|
|
246
246
|
naver_cookie_dir = "C:/naver_cookie"
|
247
247
|
FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
|
248
248
|
if proxy == ''
|
249
|
-
|
249
|
+
|
250
|
+
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
|
251
|
+
|
250
252
|
else
|
251
|
-
|
253
|
+
|
254
|
+
system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --proxy-server=#{proxy.to_s.force_encoding('utf-8').to_s} --no-first-run --no-default-browser-check --disable-sync})
|
255
|
+
|
252
256
|
end
|
253
257
|
end
|
254
258
|
def chrome_start(proxy, user_id)
|
@@ -260,6 +264,9 @@ class Naver
|
|
260
264
|
options = Selenium::WebDriver::Chrome::Options.new
|
261
265
|
options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
|
262
266
|
options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
|
267
|
+
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
268
|
+
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
269
|
+
options.add_argument('--no-default-browser-check')
|
263
270
|
options.page_load_strategy = :normal
|
264
271
|
options.timeouts = {page_load: 20_000}
|
265
272
|
options.page_load_strategy = 'none'
|
@@ -285,6 +292,9 @@ class Naver
|
|
285
292
|
options = Selenium::WebDriver::Chrome::Options.new
|
286
293
|
options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
|
287
294
|
options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
|
295
|
+
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
296
|
+
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
297
|
+
options.add_argument('--no-default-browser-check')
|
288
298
|
options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
|
289
299
|
options.page_load_strategy = :normal
|
290
300
|
options.timeouts = {page_load: 20_000}
|
@@ -309,6 +319,9 @@ class Naver
|
|
309
319
|
options = Selenium::WebDriver::Chrome::Options.new
|
310
320
|
options.add_argument('--no-first-run') # 자동 실행 시 나타나는 "첫 실행" 화면 방지
|
311
321
|
options.add_argument('--disable-extensions') # 확장 프로그램 초기화 화면 방지
|
322
|
+
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
323
|
+
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
324
|
+
options.add_argument('--no-default-browser-check')
|
312
325
|
options.page_load_strategy = :normal
|
313
326
|
options.timeouts = {page_load: 20_000}
|
314
327
|
options.page_load_strategy = 'none'
|
@@ -334,6 +347,7 @@ class Naver
|
|
334
347
|
|
335
348
|
|
336
349
|
|
350
|
+
|
337
351
|
def login(user_id, user_pw, proxy)
|
338
352
|
@user_id = user_id
|
339
353
|
@user_id11 = user_id
|
@@ -372,13 +386,20 @@ class Naver
|
|
372
386
|
puts'[Step.02] 계정 세션 확인!! 로그인 skip.......'.yellow
|
373
387
|
sleep(2.5)
|
374
388
|
rescue
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
389
|
+
begin
|
390
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
391
|
+
# 요소가 나타날 때까지 기다립니다.
|
392
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]') }
|
393
|
+
sleep(1.5)
|
394
|
+
|
395
|
+
# 요소가 있으면 클릭
|
396
|
+
@driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]').click
|
397
|
+
check_cookie_login = 0
|
398
|
+
sleep(1)
|
399
|
+
rescue
|
400
|
+
@driver.quit
|
401
|
+
return 0
|
402
|
+
end
|
382
403
|
end
|
383
404
|
|
384
405
|
if check_cookie_login == 0
|
@@ -413,8 +434,9 @@ class Naver
|
|
413
434
|
puts "Failed to close tab: #{e.message}"
|
414
435
|
end
|
415
436
|
end
|
416
|
-
return 0
|
417
437
|
@driver.quit
|
438
|
+
return 0
|
439
|
+
|
418
440
|
end
|
419
441
|
|
420
442
|
else
|
@@ -437,8 +459,9 @@ class Naver
|
|
437
459
|
puts "Failed to close tab: #{e.message}"
|
438
460
|
end
|
439
461
|
end
|
440
|
-
return 0
|
441
462
|
@driver.quit
|
463
|
+
return 0
|
464
|
+
|
442
465
|
end
|
443
466
|
end
|
444
467
|
|
@@ -764,8 +787,9 @@ class Naver
|
|
764
787
|
puts "Failed to close tab: #{e.message}"
|
765
788
|
end
|
766
789
|
end
|
767
|
-
|
768
|
-
|
790
|
+
@driver.quit
|
791
|
+
return 0
|
792
|
+
|
769
793
|
end
|
770
794
|
|
771
795
|
|
@@ -793,8 +817,9 @@ class Naver
|
|
793
817
|
puts "Failed to close tab: #{e.message}"
|
794
818
|
end
|
795
819
|
end
|
796
|
-
return 0
|
797
820
|
@driver.quit
|
821
|
+
return 0
|
822
|
+
|
798
823
|
end
|
799
824
|
sleep(2)
|
800
825
|
@driver.action.key_down(:control).key_down('a').key_up('a').key_up(:control).perform
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_basics_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.59
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|