cafe_buy 0.1.57 → 0.1.60

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/cafe_buy.rb +18 -36
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52cd8856cfd50d9896d4a00ffaeb1592464dd77d524a66388a7099672271a5ec
4
- data.tar.gz: 26d4fc276e61179de3cb9b4a8e90bcbf9e90429dad62e7e5c7806f1d45ce6748
3
+ metadata.gz: 4efdf3dbf03b71395f587057ad33c3437a758562adeb7de2a73bdd3bf02d3a2e
4
+ data.tar.gz: 669155765deb67823e0c8ee1aaa6cec597983acfa60aabf12eec298d20525da0
5
5
  SHA512:
6
- metadata.gz: 2f85498f113ae3743a318746e5bdc20942d848c99b428366b727d286b17607244691a5a9420ae3b4a9fade36e5068c94dd16eb513a3dc949a4e1888b03883bb0
7
- data.tar.gz: 6e93c8f4fb5a81a0aff47285032c7fd4ce33505f4ed2551189cd6b19712dd7134d2139d5544046a1fa6ce56028919af84e85af2a08042d53ae990c8d3e177892
6
+ metadata.gz: 598f580baa7a64e92b4fbe057e7b08b516b8d7a0735ca8b7a9926aaa43b8e2cf468793c63c537961575f98a2742f3b822a0d7a0dee57bfb90bccf69e898b97f0
7
+ data.tar.gz: bdbb87dee05011f5611a794d51d0992435516f608ae68fcd1d2c3771dd93238cf56d912c276f4dbae41e358e044f72be249959b900e85e57a1b6036b50f20530
data/lib/cafe_buy.rb CHANGED
@@ -314,11 +314,11 @@ class Naver
314
314
  FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
315
315
  if proxy == ''
316
316
 
317
- 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})
317
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.naver.com/ --remote-debugging-port=9222 --user-data-dir=C:/naver_cookie/#{user_id} --no-first-run --no-default-browser-check --disable-sync})
318
318
 
319
319
  else
320
320
 
321
- 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})
321
+ system(%{"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" https://my.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})
322
322
 
323
323
  end
324
324
  end
@@ -472,68 +472,51 @@ class Naver
472
472
 
473
473
 
474
474
  chrome_start(proxy, user_id)
475
- @driver.get('https://www.naver.com')
476
- puts'[Step.01] 계정 로그인 및 세션 확인.......'.yellow
477
-
475
+
478
476
 
479
477
  sleep(1)
480
478
 
481
479
  begin
482
- wait = Selenium::WebDriver::Wait.new(:timeout => 7)
480
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
483
481
  #요소가 나타날 때까지 3초 동안 기다립니다.
484
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__btn_logout___bsTOJ"]') }
482
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
485
483
  sleep(1.5)
486
484
  check_cookie_login = 1
487
- puts'[Step.02] 계정 세션 확인!! 로그인 skip.......'.yellow
485
+ puts' 계정 세션 확인!! 로그인 skip.......'.yellow
488
486
  sleep(2.5)
489
487
  rescue
490
488
  begin
491
- wait = Selenium::WebDriver::Wait.new(:timeout => 7)
492
- # 요소가 나타날 때까지 기다립니다.
493
- wait.until { @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]') }
489
+ wait = Selenium::WebDriver::Wait.new(:timeout => 3)
490
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]') }
494
491
  sleep(1.5)
495
-
496
- # 요소가 있으면 클릭
497
- @driver.find_element(:xpath, '//*[@class="MyView-module__link_login___HpHMW"]').click
492
+ @driver.find_element(:xpath, '//*[@class="HeaderView_login_text__pFpJ_"]').click
498
493
  check_cookie_login = 0
499
494
  sleep(1)
500
495
  rescue
501
-
502
- return 0
503
496
  @driver.quit
497
+ return 0
504
498
  end
505
499
  end
506
500
 
507
501
  if check_cookie_login == 0
508
- puts'[Step.02] 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
502
+ puts' 계정 세션이 없거나 기간 만료로 인해 로그인 시도.......'.yellow
509
503
  # @driver.find_element(:xpath, '//*[@id="right-content-area"]/div[1]/div[1]/div/a').click
510
504
  sleep(3)
511
505
  begin
512
506
  wait = Selenium::WebDriver::Wait.new(:timeout => 7)
513
507
  #요소가 나타날 때까지 3초 동안 기다립니다.
514
- wait.until { @driver.find_element(:xpath, '//*[@id="id" and @name="id"]') }
515
- @driver.find_element(:xpath, '//*[@id="id" and @name="id"]').click
508
+ wait.until { @driver.find_element(:xpath, '//*[@id="id"]') }
509
+ sleep(1.5)
510
+
511
+ @driver.find_element(:xpath, '//*[@id="id"]').click
516
512
  Clipboard.copy(user_id)
517
513
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
518
514
  sleep(1.5)
519
- @driver.find_element(:xpath, '//*[@id="pw" and @name="pw"]').click
515
+ @driver.find_element(:xpath, '//*[@id="pw"]').click
520
516
  Clipboard.copy(user_pw)
521
517
  @driver.action.key_down(:control).send_keys('v').key_up(:control).perform
522
518
  sleep(1.5)
523
-
524
- begin
525
- smart_level_value = @driver.find_element(id: 'smart_LEVEL').attribute('value')
526
- if smart_level_value == '1'
527
- @driver.find_element(xpath: '//label[@for="switch" and @class="switch_btn"]').click
528
- sleep(1.5)
529
- end
530
- rescue
531
- end
532
-
533
- wait = Selenium::WebDriver::Wait.new(:timeout => 3)
534
- #요소가 나타날 때까지 3초 동안 기다립니다.
535
- wait.until { @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]') }
536
- @driver.find_element(xpath: '//button[@type="submit" and @id="log.login"]').click
519
+ @driver.find_element(:xpath, '//*[@type="submit" and @class="btn_check next_step" and @id="submit_btn"]').click
537
520
  sleep(2.5)
538
521
  rescue => e
539
522
  puts '-[√] 로딩 지연 접속 실패.......'.red
@@ -557,8 +540,7 @@ class Naver
557
540
  begin
558
541
  wait = Selenium::WebDriver::Wait.new(:timeout => 5)
559
542
  #요소가 나타날 때까지 3초 동안 기다립니다.
560
- wait.until { @driver.find_element(:xpath, '//*[@type="button" and @class="MyView-module__btn_logout___bsTOJ"]') }
561
-
543
+ wait.until { @driver.find_element(:xpath, '//*[@class="HeaderView_email__beGsy"]') }
562
544
  rescue => e
563
545
  puts '-[√] 로그인 실패.......'.red
564
546
  @driver.window_handles.each do |handle|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafe_buy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.57
4
+ version: 0.1.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-08 00:00:00.000000000 Z
10
+ date: 2025-07-14 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: File to Clipboard gem
13
13
  email: mymin26@naver.com