zon_blog_comment 0.0.32 → 0.0.33

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/zon_blog_comment.rb +36 -23
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b26aef8dc809e7f4bcde893160ae1fb293b6ff08cc014dba865567b3504816a
4
- data.tar.gz: '03659c3ac4c279d1f4a25b141dffd91a999ea1f080d79716d26ed0640a6ba8d4'
3
+ metadata.gz: 92ec2e191c336a75ee7104751f0f1935dfda56c8de87c1ecbed379431cb39ac3
4
+ data.tar.gz: 8ed30d9f82da19f66be1aff706b0f8ff30e151ec7289f9b636a0b6945baf195f
5
5
  SHA512:
6
- metadata.gz: 3e0f15cf85c3a53b9ec348708b16c0fad99d376cb8a38410086e5a1331de8313510509400a6936f90e143acc3df5404327438c24b4ac43950ec32fb65cbe45fa
7
- data.tar.gz: df080b1de00afa50f75e62a7b6e6af0c1c6ed187f91bc41f659ef13bcb4c27232b1757c8a830293a70d3c16559f56ef9dc49dc7fd15b033c184c765aca4a13ab
6
+ metadata.gz: 2577c77753e136477b7e17ff899b82eee43bb346ebc691dc1828efdf06eeb31b219d4100c80da9d3dfe4605ffa50d5cd9eabf9eefacd5d4ef84ecefddd2cbfec
7
+ data.tar.gz: 84a7c142972560e83d3def732022a3b53bde009f372af316e55db99c03f25d33553837aaeff08a3d12527789503407874c55064841197a578de48f6b43a609ca
@@ -460,29 +460,42 @@ class Naver
460
460
  @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
461
461
  sleep(1)
462
462
  begin
463
- @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
464
- sleep(2)
465
- rescue
466
- begin
467
- @driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
468
- sleep(2)
469
- wait = Selenium::WebDriver::Wait.new(:timeout => 5)
470
- wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
471
- @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
472
- sleep(2)
473
- rescue => e
474
- @driver.window_handles.each do |handle|
475
- @driver.switch_to.window(handle)
476
- begin
477
- # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
478
- puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
479
- @driver.close
480
- rescue Selenium::WebDriver::Error::WebDriverError => e
481
- puts "Failed to close tab: #{e.message}"
482
- end
483
- end
484
- @driver.quit
485
- end
463
+ @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
464
+ sleep(2)
465
+ rescue
466
+ begin
467
+ @driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
468
+ sleep(2)
469
+ begin
470
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
471
+ wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
472
+ element = @driver.find_element(:xpath, '//*[@id="category0"]')
473
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
474
+ sleep(2)
475
+ @driver.find_element(:xpath, '//*[@id="category0"]').click
476
+ sleep(2)
477
+ rescue
478
+ end
479
+ wait = Selenium::WebDriver::Wait.new(:timeout => 5)
480
+ wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
481
+ element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
482
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
483
+ sleep(2)
484
+ @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
485
+ sleep(1)
486
+ rescue => e
487
+ @driver.window_handles.each do |handle|
488
+ @driver.switch_to.window(handle)
489
+ begin
490
+ # 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
491
+ puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
492
+ @driver.close
493
+ rescue Selenium::WebDriver::Error::WebDriverError => e
494
+ puts "Failed to close tab: #{e.message}"
495
+ end
496
+ end
497
+ @driver.quit
498
+ end
486
499
  end
487
500
 
488
501
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zon_blog_comment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon