duo_blog_cafe_comment 0.0.30 → 0.0.31
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 +65 -14
- 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: d770b2eebc49f59f4457ed4aeb951af7a24d7226aee5b621c09d52c77433e17c
|
4
|
+
data.tar.gz: 7dcf182acc3b4bb48f9ae8fa2897fed0dce6ab2e105385c541e62daceaadd95d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e19705e91e436030b11f70c7548fdfaa0f8d127d4a665b541e8d7f0023aa1e89343c84948caebd8f1b9c9424c5a117769e580baec01371a8e297f31bba23186b
|
7
|
+
data.tar.gz: b98fc748a6f2f9bbea0d325529b243afa8bad912ed85d4a0b078a675b243ab50f458ea2b0b7af84d709cbc9448acad884ea5d967c8502aad2a01b5b83ac8db32
|
@@ -1295,8 +1295,32 @@ class Naver
|
|
1295
1295
|
sleep(1)
|
1296
1296
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
1297
1297
|
sleep(1)
|
1298
|
-
|
1299
|
-
|
1298
|
+
begin
|
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
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
1306
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
1307
|
+
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
1308
|
+
sleep(2)
|
1309
|
+
rescue => e
|
1310
|
+
@driver.window_handles.each do |handle|
|
1311
|
+
@driver.switch_to.window(handle)
|
1312
|
+
begin
|
1313
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1314
|
+
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
1315
|
+
@driver.close
|
1316
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1317
|
+
puts "Failed to close tab: #{e.message}"
|
1318
|
+
end
|
1319
|
+
end
|
1320
|
+
@driver.quit
|
1321
|
+
end
|
1322
|
+
end
|
1323
|
+
|
1300
1324
|
|
1301
1325
|
begin
|
1302
1326
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
@@ -1315,22 +1339,49 @@ class Naver
|
|
1315
1339
|
sleep(2)
|
1316
1340
|
element.send_keys(:return)
|
1317
1341
|
sleep(1)
|
1318
|
-
rescue
|
1342
|
+
rescue => e
|
1343
|
+
@driver.window_handles.each do |handle|
|
1344
|
+
@driver.switch_to.window(handle)
|
1345
|
+
begin
|
1346
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1347
|
+
puts 'class="aline" 요소를 찾지 못했습니다.'
|
1348
|
+
@driver.close
|
1349
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1350
|
+
puts "Failed to close tab: #{e.message}"
|
1351
|
+
end
|
1352
|
+
end
|
1353
|
+
@driver.quit
|
1319
1354
|
end
|
1320
1355
|
end
|
1321
1356
|
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1357
|
+
begin
|
1358
|
+
# WebDriverWait과 expected_conditions 가져오기
|
1359
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5) # 10초 대기
|
1360
|
+
|
1361
|
+
# 요소가 화면에 보일 때까지 대기 후 바로 클릭
|
1362
|
+
wait.until {
|
1363
|
+
el = @driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]')
|
1364
|
+
el.displayed? # 요소가 화면에 보이는지 확인
|
1365
|
+
}
|
1366
|
+
# 요소 클릭
|
1367
|
+
@driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]').click
|
1368
|
+
sleep(1)
|
1369
|
+
rescue => e
|
1370
|
+
@driver.window_handles.each do |handle|
|
1371
|
+
@driver.switch_to.window(handle)
|
1372
|
+
begin
|
1373
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1374
|
+
puts 'data-value="30" 요소를 찾지 못했습니다.'
|
1375
|
+
@driver.close
|
1376
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1377
|
+
puts "Failed to close tab: #{e.message}"
|
1378
|
+
end
|
1379
|
+
end
|
1380
|
+
@driver.quit
|
1381
|
+
end
|
1382
|
+
|
1383
|
+
|
1325
1384
|
|
1326
|
-
# 요소가 화면에 보일 때까지 대기 후 바로 클릭
|
1327
|
-
wait.until {
|
1328
|
-
el = @driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]')
|
1329
|
-
el.displayed? # 요소가 화면에 보이는지 확인
|
1330
|
-
}
|
1331
|
-
# 요소 클릭
|
1332
|
-
@driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]').click
|
1333
|
-
sleep(1)
|
1334
1385
|
|
1335
1386
|
|
1336
1387
|
@driver.switch_to.default_content
|