duo_blog_cafe_comment 0.0.31 → 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/duo_blog_cafe_comment.rb +62 -24
- 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: 7193298753e6e33d23865ab1394c64dfc49b2454298a9682ce99af0560b6026c
|
4
|
+
data.tar.gz: 1b744c0037128597f3810aced569a0a410497d748815304027bd856fcde29e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3308ffc287e8fb0c5ad1f2ca83fef5376386d9af878a927f60a3b76cfad5400baf2eab606049af257dc7c9cd879b09d4e2ea4fbe296daab29f429ad84e3a431c
|
7
|
+
data.tar.gz: 11254145d57a9ca20c53043ea7a59062270ee587156612de267c3fc05c6ef17b9071b28edc2245de1dd4ac0bebb2d29756b8fc697c642eaaee70d3442ec178c0
|
@@ -1296,29 +1296,42 @@ class Naver
|
|
1296
1296
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
1297
1297
|
sleep(1)
|
1298
1298
|
begin
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1299
|
+
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
1300
|
+
sleep(2)
|
1301
|
+
rescue
|
1302
|
+
begin
|
1303
|
+
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
|
1304
|
+
sleep(2)
|
1305
|
+
begin
|
1306
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1307
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
|
1308
|
+
element = @driver.find_element(:xpath, '//*[@id="category0"]')
|
1309
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1310
|
+
sleep(2)
|
1311
|
+
@driver.find_element(:xpath, '//*[@id="category0"]').click
|
1312
|
+
sleep(2)
|
1313
|
+
rescue
|
1314
|
+
end
|
1315
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1316
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
1317
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
1318
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
1319
|
+
sleep(2)
|
1320
|
+
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
1321
|
+
sleep(1)
|
1322
|
+
rescue => e
|
1323
|
+
@driver.window_handles.each do |handle|
|
1324
|
+
@driver.switch_to.window(handle)
|
1325
|
+
begin
|
1326
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1327
|
+
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
1328
|
+
@driver.close
|
1329
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1330
|
+
puts "Failed to close tab: #{e.message}"
|
1331
|
+
end
|
1332
|
+
end
|
1333
|
+
@driver.quit
|
1334
|
+
end
|
1322
1335
|
end
|
1323
1336
|
|
1324
1337
|
|
@@ -1391,7 +1404,7 @@ class Naver
|
|
1391
1404
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
1392
1405
|
sleep(1)
|
1393
1406
|
|
1394
|
-
# 수집된 URL을 저장할 배열
|
1407
|
+
# 수집된 URL을 저장할 배열
|
1395
1408
|
collected_urls = []
|
1396
1409
|
|
1397
1410
|
# 현재 페이지에서 수집할 링크 개수
|
@@ -2065,9 +2078,34 @@ class Naver
|
|
2065
2078
|
end
|
2066
2079
|
end
|
2067
2080
|
sleep(1)
|
2081
|
+
begin
|
2068
2082
|
element = @driver.find_element(:xpath, '//*[@data-uiselector="writeButton"]')
|
2069
2083
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2084
|
+
sleep(2)
|
2070
2085
|
@driver.find_element(:xpath, '//*[@data-uiselector="writeButton"]').click #등록버튼
|
2086
|
+
rescue
|
2087
|
+
begin
|
2088
|
+
element = @driver.find_element(:xpath, '//*[@data-ui-selector="writeButton"]')
|
2089
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2090
|
+
sleep(2)
|
2091
|
+
@driver.find_element(:xpath, '//*[@data-ui-selector="writeButton"]').click #등록버튼
|
2092
|
+
rescue
|
2093
|
+
begin
|
2094
|
+
element = @driver.find_element(:xpath, '//*[@class="u_cbox_txt_upload"]')
|
2095
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2096
|
+
sleep(2)
|
2097
|
+
@driver.find_element(:xpath, '//*[@class="u_cbox_txt_upload"]').click #등록버튼
|
2098
|
+
rescue
|
2099
|
+
end
|
2100
|
+
begin
|
2101
|
+
element = @driver.find_element(:xpath, '//*[@data-log="RPC.write"]')
|
2102
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
2103
|
+
sleep(2)
|
2104
|
+
@driver.find_element(:xpath, '//*[@data-log="RPC.write"]').click #등록버튼
|
2105
|
+
rescue
|
2106
|
+
end
|
2107
|
+
end
|
2108
|
+
end
|
2071
2109
|
puts "#{board_url} [댓글 작성 완료 !!]".cyan
|
2072
2110
|
|
2073
2111
|
sleep(2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duo_blog_cafe_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|