duo_blog_cafe_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/duo_blog_cafe_comment.rb +37 -24
- 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: 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
|
# 현재 페이지에서 수집할 링크 개수
|