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.
- checksums.yaml +4 -4
- data/lib/zon_blog_comment.rb +36 -23
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92ec2e191c336a75ee7104751f0f1935dfda56c8de87c1ecbed379431cb39ac3
|
4
|
+
data.tar.gz: 8ed30d9f82da19f66be1aff706b0f8ff30e151ec7289f9b636a0b6945baf195f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2577c77753e136477b7e17ff899b82eee43bb346ebc691dc1828efdf06eeb31b219d4100c80da9d3dfe4605ffa50d5cd9eabf9eefacd5d4ef84ecefddd2cbfec
|
7
|
+
data.tar.gz: 84a7c142972560e83d3def732022a3b53bde009f372af316e55db99c03f25d33553837aaeff08a3d12527789503407874c55064841197a578de48f6b43a609ca
|
data/lib/zon_blog_comment.rb
CHANGED
@@ -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
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
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
|
|