zon_blog_comment 0.0.53 → 0.0.55
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 +37 -36
- 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: 1d7340486eaff486cd290d63cc012e9397cb885cff0725c3c76d0f98e222891b
|
4
|
+
data.tar.gz: ea0feef7efdbacbe4a3e899bcea885c52356f30415acf3b40f929c99a929b909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7570e12b5d1291eb8f3a7c7b760d8980d67ecbd5aae311d6df07d514224a44a85b35106b0ed76d782ae4a29391b9f1b380f3598960c4c85a6259040312ee55b5
|
7
|
+
data.tar.gz: 7a7f2caf4dadc72d01016a8ac8d5910ecb52af8c8859590013e282a01cebcac5d6a7c038f0c2fd8271c29ccdcf6a306d3e5e1c352571144845437ce955d0aa2d
|
data/lib/zon_blog_comment.rb
CHANGED
@@ -471,48 +471,60 @@ class Naver
|
|
471
471
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
472
472
|
sleep(1)
|
473
473
|
begin
|
474
|
-
|
475
|
-
|
476
|
-
|
474
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') # 목록 열기 코드
|
475
|
+
text = element.text.strip
|
476
|
+
|
477
|
+
if text == "목록열기"
|
478
|
+
element.click
|
479
|
+
sleep(2)
|
480
|
+
else
|
481
|
+
|
482
|
+
end
|
483
|
+
rescue
|
477
484
|
begin
|
478
|
-
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
|
479
|
-
sleep(2)
|
485
|
+
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click #블로그 txt 클릭
|
486
|
+
sleep(2)
|
487
|
+
rescue
|
488
|
+
begin
|
489
|
+
@driver.find_element(:xpath, '//*[@class="on itemfont _doNclick _param(false|blog|)"]').click #블로그 txt 클릭
|
490
|
+
sleep(2)
|
491
|
+
rescue
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
begin
|
480
496
|
begin
|
481
497
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
482
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
|
498
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') } # 전체 보기 클릭
|
483
499
|
element = @driver.find_element(:xpath, '//*[@id="category0"]')
|
484
500
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
485
501
|
sleep(2)
|
486
|
-
@driver.find_element(:xpath, '//*[@id="category0"]').click
|
502
|
+
@driver.find_element(:xpath, '//*[@id="category0"]').click # 전체 보기 클릭
|
487
503
|
sleep(2)
|
488
504
|
rescue
|
489
505
|
end
|
490
506
|
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
491
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
507
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') } # 목록 열기 코드
|
492
508
|
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
493
509
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
494
|
-
sleep(2)
|
495
|
-
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
503
|
-
@driver.close
|
504
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
505
|
-
puts "Failed to close tab: #{e.message}"
|
506
|
-
end
|
510
|
+
sleep(2)
|
511
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
512
|
+
text = element.text.strip
|
513
|
+
|
514
|
+
if text == "목록열기"
|
515
|
+
element.click
|
516
|
+
sleep(2)
|
517
|
+
else
|
507
518
|
end
|
508
|
-
|
519
|
+
sleep(1)
|
520
|
+
rescue
|
509
521
|
end
|
510
522
|
end
|
511
523
|
|
512
524
|
|
513
525
|
begin
|
514
526
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
515
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') }
|
527
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="aline"]') } # 목록 리스트 (5줄 보기) 클릭
|
516
528
|
element = @driver.find_element(:xpath, '//*[@class="aline"]')
|
517
529
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
518
530
|
sleep(2)
|
@@ -521,24 +533,13 @@ class Naver
|
|
521
533
|
rescue
|
522
534
|
begin
|
523
535
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
524
|
-
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') }
|
536
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="listCountToggle"]') } # 목록 리스트 (5줄 보기) 클릭
|
525
537
|
element = @driver.find_element(:xpath, '//*[@id="listCountToggle"]')
|
526
538
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
527
539
|
sleep(2)
|
528
540
|
element.send_keys(:return)
|
529
541
|
sleep(1)
|
530
|
-
rescue
|
531
|
-
@driver.window_handles.each do |handle|
|
532
|
-
@driver.switch_to.window(handle)
|
533
|
-
begin
|
534
|
-
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
535
|
-
puts 'class="aline" 요소를 찾지 못했습니다.'
|
536
|
-
@driver.close
|
537
|
-
rescue Selenium::WebDriver::Error::WebDriverError => e
|
538
|
-
puts "Failed to close tab: #{e.message}"
|
539
|
-
end
|
540
|
-
end
|
541
|
-
@driver.quit
|
542
|
+
rescue
|
542
543
|
end
|
543
544
|
end
|
544
545
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zon_blog_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-06-
|
10
|
+
date: 2025-06-19 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|