duo_blog_comment 0.0.25 → 0.0.27
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_comment.rb +21 -23
- 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: bc867f7a2c5c2f2ad6cf60e7020e4fd965559b956bf088cc9b7a01dacfc85168
|
4
|
+
data.tar.gz: b6a01915f95a5934e6dcf3876f808940256c063c1accca7bf4ba2a344597b6a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16ec2f93e646e9b6728e784d9132a530a5422498b479d2ccee6a51512cdf006b75a129cef40ac74781b551292fe9dacfca14d4e3f511ef27832523bc62ce4dd9
|
7
|
+
data.tar.gz: 4730886583f0f6f3b1957b54a6b1bcf3751ede4524c667a1f860467b422f3f0b001415a0c286c66a0d905e9c9408df9abd417a3f3a1b589f47c52cf5508bcb02
|
data/lib/duo_blog_comment.rb
CHANGED
@@ -454,52 +454,50 @@ class Naver
|
|
454
454
|
|
455
455
|
elsif option['타겟블로그'] == 'true'
|
456
456
|
@driver.get(blog_url)
|
457
|
-
|
457
|
+
puts '-진행1.......'.red
|
458
458
|
wait = Selenium::WebDriver::Wait.new(:timeout => 20) # 아이프레임 선택
|
459
459
|
wait.until { @driver.find_element(:xpath, '//*[@id="mainFrame"]') } # 아이프레임 선택
|
460
460
|
sleep(1)
|
461
461
|
@driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="mainFrame"]')) # 아이프레임 선택
|
462
462
|
sleep(1)
|
463
|
-
|
463
|
+
puts '-진행2.......'.red
|
464
464
|
@driver.find_element(:xpath, '//*[@id="toplistSpanBlind"]').click
|
465
465
|
sleep(2)
|
466
|
+
puts '-진행3.......'.red
|
466
467
|
begin
|
467
468
|
element = @driver.find_element(:xpath, '//*[@class="aline"]')
|
468
469
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
469
470
|
sleep(2)
|
470
|
-
element
|
471
|
+
element.send_keys(:return)
|
471
472
|
sleep(1)
|
473
|
+
puts '-진행4.......'.red
|
472
474
|
rescue
|
473
475
|
begin
|
474
476
|
element = @driver.find_element(:xpath, '//*[@id="listCountToggle"]')
|
475
477
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
476
478
|
sleep(2)
|
477
|
-
element
|
479
|
+
element.send_keys(:return)
|
478
480
|
sleep(1)
|
481
|
+
puts '-진행5.......'.red
|
479
482
|
rescue
|
480
|
-
|
481
|
-
element = @driver.find_element(:xpath, '//*[@id="listCountView"]')
|
482
|
-
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
483
|
-
sleep(2)
|
484
|
-
element = @driver.find_element(:xpath, '//*[@id="listCountView"]').click
|
485
|
-
sleep(1)
|
486
|
-
rescue
|
487
|
-
begin
|
488
|
-
element = @driver.find_element(:xpath, '//i[@class="icon"]')
|
489
|
-
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", element)#크롤 이동
|
490
|
-
sleep(2)
|
491
|
-
element = @driver.find_element(:xpath, '//i[@class="icon"]').click
|
492
|
-
sleep(1)
|
493
|
-
rescue
|
494
|
-
|
495
|
-
end
|
496
|
-
end
|
483
|
+
|
497
484
|
end
|
498
485
|
end
|
499
486
|
|
500
|
-
|
501
|
-
|
487
|
+
puts '-진행8.......'.red
|
488
|
+
# WebDriverWait과 expected_conditions 가져오기
|
489
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 10) # 10초 대기
|
490
|
+
|
491
|
+
# 요소가 화면에 보일 때까지 대기 후 바로 클릭
|
492
|
+
wait.until {
|
493
|
+
el = @driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]')
|
494
|
+
el.displayed? # 요소가 화면에 보이는지 확인
|
495
|
+
}
|
502
496
|
|
497
|
+
# 요소 클릭
|
498
|
+
@driver.find_element(:xpath, '//div[@id="changeListCount"]//a[@data-value="30"]').click
|
499
|
+
|
500
|
+
puts '-진행9.......'.red
|
503
501
|
@driver.switch_to.default_content
|
504
502
|
|
505
503
|
|