zon_blog_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/zon_blog_comment.rb +60 -23
- 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: 92ec2e191c336a75ee7104751f0f1935dfda56c8de87c1ecbed379431cb39ac3
|
4
|
+
data.tar.gz: 8ed30d9f82da19f66be1aff706b0f8ff30e151ec7289f9b636a0b6945baf195f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2577c77753e136477b7e17ff899b82eee43bb346ebc691dc1828efdf06eeb31b219d4100c80da9d3dfe4605ffa50d5cd9eabf9eefacd5d4ef84ecefddd2cbfec
|
7
|
+
data.tar.gz: 84a7c142972560e83d3def732022a3b53bde009f372af316e55db99c03f25d33553837aaeff08a3d12527789503407874c55064841197a578de48f6b43a609ca
|
data/lib/zon_blog_comment.rb
CHANGED
@@ -460,29 +460,42 @@ class Naver
|
|
460
460
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
461
461
|
sleep(1)
|
462
462
|
begin
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
463
|
+
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
464
|
+
sleep(2)
|
465
|
+
rescue
|
466
|
+
begin
|
467
|
+
@driver.find_element(:xpath, '//*[@class="off itemfont _doNclick _param(false|blog|)"]').click
|
468
|
+
sleep(2)
|
469
|
+
begin
|
470
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
471
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="category0"]') }
|
472
|
+
element = @driver.find_element(:xpath, '//*[@id="category0"]')
|
473
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
474
|
+
sleep(2)
|
475
|
+
@driver.find_element(:xpath, '//*[@id="category0"]').click
|
476
|
+
sleep(2)
|
477
|
+
rescue
|
478
|
+
end
|
479
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
480
|
+
wait.until { @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]') }
|
481
|
+
element = @driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]')
|
482
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
483
|
+
sleep(2)
|
484
|
+
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
485
|
+
sleep(1)
|
486
|
+
rescue => e
|
487
|
+
@driver.window_handles.each do |handle|
|
488
|
+
@driver.switch_to.window(handle)
|
489
|
+
begin
|
490
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
491
|
+
puts 'id="toplistSpanBlind" 요소를 찾지 못했습니다.'
|
492
|
+
@driver.close
|
493
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
494
|
+
puts "Failed to close tab: #{e.message}"
|
495
|
+
end
|
496
|
+
end
|
497
|
+
@driver.quit
|
498
|
+
end
|
486
499
|
end
|
487
500
|
|
488
501
|
|
@@ -1231,10 +1244,34 @@ class Naver
|
|
1231
1244
|
end
|
1232
1245
|
end
|
1233
1246
|
sleep(1)
|
1247
|
+
begin
|
1234
1248
|
element = @driver.find_element(:xpath, '//*[@data-uiselector="writeButton"]')
|
1235
1249
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
1236
1250
|
sleep(2)
|
1237
1251
|
@driver.find_element(:xpath, '//*[@data-uiselector="writeButton"]').click #등록버튼
|
1252
|
+
rescue
|
1253
|
+
begin
|
1254
|
+
element = @driver.find_element(:xpath, '//*[@data-ui-selector="writeButton"]')
|
1255
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
1256
|
+
sleep(2)
|
1257
|
+
@driver.find_element(:xpath, '//*[@data-ui-selector="writeButton"]').click #등록버튼
|
1258
|
+
rescue
|
1259
|
+
begin
|
1260
|
+
element = @driver.find_element(:xpath, '//*[@class="u_cbox_txt_upload"]')
|
1261
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
1262
|
+
sleep(2)
|
1263
|
+
@driver.find_element(:xpath, '//*[@class="u_cbox_txt_upload"]').click #등록버튼
|
1264
|
+
rescue
|
1265
|
+
end
|
1266
|
+
begin
|
1267
|
+
element = @driver.find_element(:xpath, '//*[@data-log="RPC.write"]')
|
1268
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element) # 크롤 이동
|
1269
|
+
sleep(2)
|
1270
|
+
@driver.find_element(:xpath, '//*[@data-log="RPC.write"]').click #등록버튼
|
1271
|
+
rescue
|
1272
|
+
end
|
1273
|
+
end
|
1274
|
+
end
|
1238
1275
|
posting_url = @driver.current_url
|
1239
1276
|
puts "#{posting_url} [댓글 작성 완료 !!]".cyan
|
1240
1277
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.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
|