zon_cafe_comment 0.0.27 → 0.0.30
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_cafe_comment.rb +57 -21
- 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: bf361e7bb7ca0da6f07c4c51d68fc75c592e0a575abb6d40d12eaa0e0ebba87b
|
4
|
+
data.tar.gz: 9474e2940280eba9783b048842d2d3c3e9a681a871499d3a3f2b12545d132d3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2ca40ba3296246c4e86812348b9298246340b9665ea8341e68e13fc4e1ad9971518e1b456d85be55560dd83b16e9382fb79bb71d0f05615f9d517812e45fc6
|
7
|
+
data.tar.gz: 6a09f38bbd36cf77c4f758bbb98ad1275bc171f269ff2e6bfb95f7a0350fa685485d4a815d6baa118e2e13b6dfe7ada809e346095a105327cba55284f324a940
|
data/lib/zon_cafe_comment.rb
CHANGED
@@ -404,7 +404,18 @@ class Naver
|
|
404
404
|
sleep(1)
|
405
405
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="cafe_main"]')) # 아이프레임 선택
|
406
406
|
@in_iframe = true
|
407
|
-
end
|
407
|
+
end
|
408
|
+
|
409
|
+
begin
|
410
|
+
# 아이프레임 요소가 나타날 때까지 기다립니다.
|
411
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
412
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="FormInputCheck"]') }
|
413
|
+
sleep(1)
|
414
|
+
@driver.find_element(:xpath, '//*[@class="FormInputCheck"]').click
|
415
|
+
sleep(2)
|
416
|
+
rescue
|
417
|
+
|
418
|
+
end
|
408
419
|
|
409
420
|
# 한 페이지에 게시글이 15개씩 있다고 가정
|
410
421
|
articles_per_page = 15
|
@@ -431,17 +442,28 @@ class Naver
|
|
431
442
|
# 페이지 넘기기: 다음 페이지로 이동 (class="prev-next" 아래의 페이지 링크 클릭)
|
432
443
|
|
433
444
|
begin
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
445
|
+
next_page_number = (current_page + 1).to_s
|
446
|
+
|
447
|
+
# 페이지 번호 버튼들 찾기
|
448
|
+
pagination_buttons = @driver.find_elements(:css, 'div.Pagination button.btn.number')
|
449
|
+
|
450
|
+
# 텍스트가 다음 페이지 숫자와 같은 버튼 찾기
|
451
|
+
next_button = pagination_buttons.find { |btn| btn.text == next_page_number }
|
452
|
+
|
453
|
+
if next_button
|
454
|
+
next_button.click
|
455
|
+
sleep(2) # 페이지가 로드되도록 대기
|
456
|
+
current_page += 1
|
457
|
+
else
|
458
|
+
puts "다음 페이지 버튼을 찾을 수 없습니다. 현재 페이지: #{current_page}"
|
459
|
+
break
|
460
|
+
end
|
461
|
+
|
462
|
+
rescue => e
|
463
|
+
puts "페이지 넘김 중 오류 발생: #{e.message}"
|
464
|
+
break
|
440
465
|
end
|
441
|
-
|
442
|
-
# 페이지 번호 갱신
|
443
|
-
current_page += 1
|
444
|
-
end
|
466
|
+
end
|
445
467
|
# 수집한 URL 출력
|
446
468
|
|
447
469
|
if @in_iframe
|
@@ -911,6 +933,9 @@ class Naver
|
|
911
933
|
@in_iframe = true
|
912
934
|
end
|
913
935
|
|
936
|
+
|
937
|
+
|
938
|
+
|
914
939
|
|
915
940
|
# 한 페이지에 게시글이 15개씩 있다고 가정
|
916
941
|
articles_per_page = 15
|
@@ -940,16 +965,27 @@ class Naver
|
|
940
965
|
# 페이지 넘기기: 다음 페이지로 이동 (class="prev-next" 아래의 페이지 링크 클릭)
|
941
966
|
|
942
967
|
begin
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
puts "더 이상 페이지가 없습니다."
|
948
|
-
break # 더 이상 페이지가 없다면 종료
|
949
|
-
end
|
968
|
+
next_page_number = (current_page + 1).to_s
|
969
|
+
|
970
|
+
# 페이지 번호 버튼들 찾기
|
971
|
+
pagination_buttons = @driver.find_elements(:css, 'div.Pagination button.btn.number')
|
950
972
|
|
951
|
-
|
952
|
-
|
973
|
+
# 텍스트가 다음 페이지 숫자와 같은 버튼 찾기
|
974
|
+
next_button = pagination_buttons.find { |btn| btn.text == next_page_number }
|
975
|
+
|
976
|
+
if next_button
|
977
|
+
next_button.click
|
978
|
+
sleep(2) # 페이지가 로드되도록 대기
|
979
|
+
current_page += 1
|
980
|
+
else
|
981
|
+
puts "다음 페이지 버튼을 찾을 수 없습니다. 현재 페이지: #{current_page}"
|
982
|
+
break
|
983
|
+
end
|
984
|
+
|
985
|
+
rescue => e
|
986
|
+
puts "페이지 넘김 중 오류 발생: #{e.message}"
|
987
|
+
break
|
988
|
+
end
|
953
989
|
end
|
954
990
|
# 수집한 URL 출력
|
955
991
|
|
@@ -2223,7 +2259,7 @@ end
|
|
2223
2259
|
}
|
2224
2260
|
|
2225
2261
|
text_column('게시판/글URL LIST'){
|
2226
|
-
|
2262
|
+
editable true
|
2227
2263
|
}
|
2228
2264
|
|
2229
2265
|
cell_rows @data['게시판설정']['게시판']
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zon_cafe_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-04-
|
10
|
+
date: 2025-04-16 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: File to Clipboard gem
|
13
13
|
email: mymin26@naver.com
|