posting_zon 3.106.999 → 3.109.999
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/posting_zon.rb +684 -321
- metadata +2 -2
data/lib/posting_zon.rb
CHANGED
@@ -31,14 +31,14 @@ class ChromeKiller
|
|
31
31
|
wmi = WIN32OLE.connect("winmgmts://")
|
32
32
|
chrome_procs = wmi.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'chrome.exe'")
|
33
33
|
chrome_procs.each do |proc|
|
34
|
-
|
35
|
-
|
34
|
+
begin
|
35
|
+
cmd = proc.CommandLine rescue nil
|
36
|
+
next unless cmd && cmd.include?("user-data-dir=C:/board_cookie")
|
37
|
+
|
36
38
|
puts "→ 크롬 창 초기화: PID #{proc.ProcessId}"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# 무시
|
41
|
-
end
|
39
|
+
proc.Terminate rescue nil
|
40
|
+
rescue => inner_e
|
41
|
+
puts "프로세스 처리 중 오류: #{inner_e.message}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
sleep(1)
|
@@ -691,97 +691,90 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
691
691
|
|
692
692
|
#오른쪽 마우스 해제 코드
|
693
693
|
begin
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
document.
|
699
|
-
|
700
|
-
|
701
|
-
@driver.execute_script <<-JS
|
702
|
-
document.addEventListener('contextmenu', function(e) {
|
703
|
-
e.stopImmediatePropagation();
|
704
|
-
}, true);
|
694
|
+
# 우 클릭 해제
|
695
|
+
@driver.execute_script <<~JS
|
696
|
+
window.alert = function() {};
|
697
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
698
|
+
document.oncontextmenu = null;
|
699
|
+
document.body.oncontextmenu = null;
|
705
700
|
JS
|
706
|
-
|
707
|
-
@driver.execute_script("window.oncontextmenu = null;")
|
708
701
|
rescue
|
709
|
-
end
|
702
|
+
end
|
710
703
|
|
711
704
|
|
712
705
|
|
713
706
|
sleep(1)
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
707
|
+
##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
|
708
|
+
|
709
|
+
puts '-[√] 1 캡챠 발생 유무 확인.......'.green
|
710
|
+
sleep(1)
|
711
|
+
puts '-[√] 2 캡챠 발생 유무 확인.......'.green
|
712
|
+
sleep(1)
|
713
|
+
puts '-[√] 3 캡챠 발생 유무 확인.......'.green
|
714
|
+
sleep(2)
|
722
715
|
|
723
716
|
|
724
717
|
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
718
|
+
begin
|
719
|
+
@driver.find_element(:xpath, '//*[@class="amzn-captcha-state-container"]')
|
720
|
+
puts '-[√] 아임웹 캡챠 확인!! 해제 실행.......'.green
|
721
|
+
sleep(1)
|
722
|
+
# 타임아웃을 3초로 설정
|
723
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
724
|
+
# 요소가 나타날 때까지 3초 동안 기다립니다.
|
725
|
+
wait.until { @driver.find_element(:xpath, '//*[@data-state="ready"]') }
|
726
|
+
sleep(1)
|
727
|
+
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
728
|
+
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
729
|
+
sleep(10)
|
730
|
+
begin
|
731
|
+
@driver.find_element(:xpath, '//*[@data-state="error"]').click
|
732
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
733
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
734
|
+
@driver.window_handles.each do |handle|
|
735
|
+
@driver.switch_to.window(handle)
|
736
|
+
begin
|
737
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
738
|
+
@driver.close
|
739
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
740
|
+
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
741
|
+
end
|
742
|
+
end
|
743
|
+
sleep(1)
|
744
|
+
@driver.quit
|
745
|
+
return 0
|
746
|
+
sleep(1)
|
747
|
+
rescue
|
748
|
+
begin
|
749
|
+
# 타임아웃을 77초로 설정
|
750
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 150)
|
751
|
+
# 요소가 나타날 때까지 100초 동안 기다립니다.
|
752
|
+
#wait.until { @driver.find_element(:xpath, '//*[@class="post_write_wrap"]') }
|
753
|
+
wait.until { @driver.find_elements(:xpath, '//*[@id="amzn-captcha-verify-button"]').size == 0 }
|
754
|
+
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다.......'.green
|
755
|
+
|
756
|
+
sleep(5)
|
757
|
+
rescue => e
|
758
|
+
puts '-[√] 캡챠 해제 실패(캡챠는 사람이 풀기에 간혹 실수로 실패가 될수있습니다.).......'.red
|
759
|
+
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
760
|
+
puts e
|
761
|
+
@driver.close
|
762
|
+
return 0
|
749
763
|
end
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
rescue => e
|
765
|
-
puts '-[√] 캡챠 해제 실패(캡챠는 사람이 풀기에 간혹 실수로 실패가 될수있습니다.).......'.red
|
766
|
-
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
767
|
-
puts e
|
768
|
-
@driver.close
|
769
|
-
return 0
|
770
|
-
end
|
771
|
-
end
|
772
|
-
rescue
|
773
|
-
begin
|
774
|
-
@driver.find_element(:xpath, '//*[@class="zone-name-title h1"]')
|
775
|
-
puts '-[√] 클라우드플레어 캡챠 확인!! 해제 실행.......'.green
|
776
|
-
|
777
|
-
# 타임아웃을 3초로 설정
|
778
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
779
|
-
# 요소가 나타날 때까지 30초 동안 기다립니다.
|
780
|
-
wait.until { @driver.find_element(:xpath, '//*[@data-state="ready"]') }
|
781
|
-
sleep(1)
|
782
|
-
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
783
|
-
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
784
|
-
sleep(10)
|
764
|
+
end
|
765
|
+
rescue
|
766
|
+
begin
|
767
|
+
@driver.find_element(:xpath, '//*[@class="zone-name-title h1"]')
|
768
|
+
puts '-[√] 클라우드플레어 캡챠 확인!! 해제 실행.......'.green
|
769
|
+
|
770
|
+
# 타임아웃을 3초로 설정
|
771
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
772
|
+
# 요소가 나타날 때까지 30초 동안 기다립니다.
|
773
|
+
wait.until { @driver.find_element(:xpath, '//*[@data-state="ready"]') }
|
774
|
+
sleep(1)
|
775
|
+
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
776
|
+
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
777
|
+
sleep(10)
|
785
778
|
begin
|
786
779
|
@driver.find_element(:xpath, '//*[@data-state="error"]').click
|
787
780
|
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
@@ -2008,24 +2001,16 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
2008
2001
|
|
2009
2002
|
sleep(1)
|
2010
2003
|
##캡챠 이미지,2캡챠,,등등 코드 부분─────────────────────────────────────────────────────────────────────>
|
2011
|
-
|
2012
|
-
|
2013
|
-
@driver.execute_script
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
document.
|
2018
|
-
JS
|
2019
|
-
|
2020
|
-
@driver.execute_script <<-JS
|
2021
|
-
document.addEventListener('contextmenu', function(e) {
|
2022
|
-
e.stopImmediatePropagation();
|
2023
|
-
}, true);
|
2004
|
+
begin
|
2005
|
+
# 우 클릭 해제
|
2006
|
+
@driver.execute_script <<~JS
|
2007
|
+
window.alert = function() {};
|
2008
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
2009
|
+
document.oncontextmenu = null;
|
2010
|
+
document.body.oncontextmenu = null;
|
2024
2011
|
JS
|
2025
|
-
|
2026
|
-
@driver.execute_script("window.oncontextmenu = null;")
|
2027
2012
|
rescue
|
2028
|
-
end
|
2013
|
+
end
|
2029
2014
|
sleep(1)
|
2030
2015
|
##캡챠 이미지,2캡챠,,등등 코드 부분─────────────────────────────────────────────────────────────────────>
|
2031
2016
|
puts '-[√] 캡챠 유형 탐색.......'.green
|
@@ -3726,24 +3711,16 @@ login_url = option['login_url'].to_s
|
|
3726
3711
|
sleep(1)
|
3727
3712
|
|
3728
3713
|
##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
|
3729
|
-
|
3730
|
-
|
3731
|
-
@driver.execute_script
|
3732
|
-
|
3733
|
-
|
3734
|
-
|
3735
|
-
document.
|
3736
|
-
JS
|
3737
|
-
|
3738
|
-
@driver.execute_script <<-JS
|
3739
|
-
document.addEventListener('contextmenu', function(e) {
|
3740
|
-
e.stopImmediatePropagation();
|
3741
|
-
}, true);
|
3714
|
+
begin
|
3715
|
+
# 우 클릭 해제
|
3716
|
+
@driver.execute_script <<~JS
|
3717
|
+
window.alert = function() {};
|
3718
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
3719
|
+
document.oncontextmenu = null;
|
3720
|
+
document.body.oncontextmenu = null;
|
3742
3721
|
JS
|
3743
|
-
|
3744
|
-
@driver.execute_script("window.oncontextmenu = null;")
|
3745
3722
|
rescue
|
3746
|
-
end
|
3723
|
+
end
|
3747
3724
|
|
3748
3725
|
sleep(5)
|
3749
3726
|
|
@@ -5177,25 +5154,17 @@ begin
|
|
5177
5154
|
|
5178
5155
|
|
5179
5156
|
|
5180
|
-
|
5181
|
-
#오른쪽 마우스 해제 코드
|
5157
|
+
sleep(1)
|
5182
5158
|
begin
|
5183
|
-
|
5184
|
-
|
5185
|
-
|
5186
|
-
|
5187
|
-
document.
|
5188
|
-
|
5189
|
-
|
5190
|
-
@driver.execute_script <<-JS
|
5191
|
-
document.addEventListener('contextmenu', function(e) {
|
5192
|
-
e.stopImmediatePropagation();
|
5193
|
-
}, true);
|
5159
|
+
# 우 클릭 해제
|
5160
|
+
@driver.execute_script <<~JS
|
5161
|
+
window.alert = function() {};
|
5162
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
5163
|
+
document.oncontextmenu = null;
|
5164
|
+
document.body.oncontextmenu = null;
|
5194
5165
|
JS
|
5195
|
-
|
5196
|
-
@driver.execute_script("window.oncontextmenu = null;")
|
5197
5166
|
rescue
|
5198
|
-
end
|
5167
|
+
end
|
5199
5168
|
##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
|
5200
5169
|
begin
|
5201
5170
|
sleep(5)
|
@@ -5569,22 +5538,14 @@ post_url = option['post_url'].to_s
|
|
5569
5538
|
end
|
5570
5539
|
|
5571
5540
|
sleep(1)
|
5572
|
-
#오른쪽 마우스 해제 코드
|
5573
5541
|
begin
|
5574
|
-
|
5575
|
-
|
5576
|
-
|
5577
|
-
|
5578
|
-
document.
|
5579
|
-
|
5580
|
-
|
5581
|
-
@driver.execute_script <<-JS
|
5582
|
-
document.addEventListener('contextmenu', function(e) {
|
5583
|
-
e.stopImmediatePropagation();
|
5584
|
-
}, true);
|
5542
|
+
# 우 클릭 해제
|
5543
|
+
@driver.execute_script <<~JS
|
5544
|
+
window.alert = function() {};
|
5545
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
5546
|
+
document.oncontextmenu = null;
|
5547
|
+
document.body.oncontextmenu = null;
|
5585
5548
|
JS
|
5586
|
-
|
5587
|
-
@driver.execute_script("window.oncontextmenu = null;")
|
5588
5549
|
rescue
|
5589
5550
|
end
|
5590
5551
|
|
@@ -5979,7 +5940,7 @@ post_url = option['post_url'].to_s
|
|
5979
5940
|
begin
|
5980
5941
|
chat_box = @driver.find_element(:xpath, '//*[@class="left_chat_box"]')
|
5981
5942
|
@driver.execute_script("arguments[0].remove();", chat_box)
|
5982
|
-
|
5943
|
+
|
5983
5944
|
sleep(1)
|
5984
5945
|
rescue
|
5985
5946
|
end
|
@@ -5992,6 +5953,14 @@ post_url = option['post_url'].to_s
|
|
5992
5953
|
rescue
|
5993
5954
|
end
|
5994
5955
|
|
5956
|
+
begin
|
5957
|
+
@driver.execute_script(<<~JS)
|
5958
|
+
document.querySelectorAll('.captcha-solver[data-widget-id="100000"]').forEach(el => el.remove());
|
5959
|
+
JS
|
5960
|
+
|
5961
|
+
puts "가짜 캡차 관련 요소 제거 완료".green
|
5962
|
+
rescue
|
5963
|
+
end
|
5995
5964
|
|
5996
5965
|
|
5997
5966
|
|
@@ -6842,7 +6811,13 @@ begin
|
|
6842
6811
|
sleep(1)
|
6843
6812
|
puts '-[√] 닉네임 26코드 타겟.......'.yellow
|
6844
6813
|
rescue
|
6845
|
-
|
6814
|
+
begin
|
6815
|
+
@driver.find_element(xpath: '//*[@data-valid-title="작성자"]').send_keys(user_id)
|
6816
|
+
sleep(1)
|
6817
|
+
puts '-[√] 닉네임 26코드 타겟.......'.yellow
|
6818
|
+
rescue
|
6819
|
+
|
6820
|
+
end
|
6846
6821
|
end
|
6847
6822
|
end
|
6848
6823
|
end
|
@@ -6986,7 +6961,13 @@ begin
|
|
6986
6961
|
sleep(1)
|
6987
6962
|
puts '-[√] 패스워드 20코드 타겟.......'.yellow
|
6988
6963
|
rescue
|
6989
|
-
|
6964
|
+
begin
|
6965
|
+
@driver.find_element(:xpath, '//*[@data-valid-title="비밀번호"]').send_keys(user_pw)
|
6966
|
+
sleep(1)
|
6967
|
+
puts '-[√] 패스워드 21코드 타겟.......'.yellow
|
6968
|
+
rescue
|
6969
|
+
|
6970
|
+
end
|
6990
6971
|
end
|
6991
6972
|
end
|
6992
6973
|
end
|
@@ -7479,7 +7460,15 @@ begin
|
|
7479
7460
|
sleep(1)
|
7480
7461
|
@driver.find_element(:xpath, '//*[@type="checkbox" and @name="fagree" and @name="fagree"]').click
|
7481
7462
|
sleep(1)
|
7463
|
+
rescue
|
7464
|
+
begin
|
7465
|
+
check = @driver.find_element(:xpath, '//div[@class="write_div"]//input[@type="checkbox" and @required]')
|
7466
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", check)
|
7467
|
+
sleep(1)
|
7468
|
+
@driver.find_element(:xpath, '//div[@class="write_div"]//input[@type="checkbox" and @required]').click
|
7469
|
+
sleep(1)
|
7482
7470
|
rescue
|
7471
|
+
end
|
7483
7472
|
end
|
7484
7473
|
end
|
7485
7474
|
end
|
@@ -7520,7 +7509,10 @@ begin
|
|
7520
7509
|
|
7521
7510
|
|
7522
7511
|
|
7523
|
-
|
7512
|
+
begin
|
7513
|
+
@driver.switch_to.default_content
|
7514
|
+
rescue
|
7515
|
+
end
|
7524
7516
|
|
7525
7517
|
|
7526
7518
|
|
@@ -7530,121 +7522,128 @@ title = title.strip
|
|
7530
7522
|
target_element = nil
|
7531
7523
|
begin
|
7532
7524
|
target_element = @driver.find_element(:xpath, '//*[@id="wr_subject"]')
|
7533
|
-
|
7525
|
+
@driver.find_element(:xpath, '//*[@id="wr_subject"]').click
|
7534
7526
|
sleep(1)
|
7535
|
-
|
7527
|
+
@driver.find_element(:xpath, '//*[@id="wr_subject"]').send_keys(title)
|
7536
7528
|
puts '-[√] 제목 code 1.......'.yellow
|
7537
7529
|
rescue
|
7538
7530
|
begin
|
7539
7531
|
target_element = @driver.find_element(:xpath, '//*[@fw-label="제목"]')
|
7540
|
-
|
7532
|
+
@driver.find_element(:xpath, '//*[@fw-label="제목"]').click
|
7541
7533
|
sleep(1)
|
7542
|
-
|
7534
|
+
@driver.find_element(:xpath, '//*[@fw-label="제목"]').send_keys(title)
|
7543
7535
|
puts '-[√] 제목 code 2.......'.yellow
|
7544
7536
|
rescue
|
7545
7537
|
begin
|
7546
7538
|
target_element = @driver.find_element(:xpath, '//*[@name="subject"]')
|
7547
|
-
|
7539
|
+
@driver.find_element(:xpath, '//*[@name="subject"]').click
|
7548
7540
|
sleep(1)
|
7549
|
-
|
7541
|
+
@driver.find_element(:xpath, '//*[@name="subject"]').send_keys(title)
|
7550
7542
|
puts '-[√] 제목 code 3.......'.yellow
|
7551
7543
|
rescue
|
7552
7544
|
begin
|
7545
|
+
target_element = @driver.find_element(xpath: "//input[@id='subject' and @name='subject']")
|
7546
|
+
@driver.find_element(xpath: "//input[@id='subject' and @name='subject']").click
|
7547
|
+
sleep(1)
|
7548
|
+
@driver.find_element(xpath: "//input[@id='subject' and @name='subject']").send_keys(title)
|
7549
|
+
puts '-[√] 제목 code 3-1.......'.yellow
|
7550
|
+
rescue
|
7551
|
+
begin
|
7553
7552
|
target_element = @driver.find_element(:xpath, '//*[@name="title"]')
|
7554
|
-
|
7553
|
+
@driver.find_element(:xpath, '//*[@name="title"]').click
|
7555
7554
|
sleep(1)
|
7556
|
-
|
7555
|
+
@driver.find_element(:xpath, '//*[@name="title"]').send_keys(title)
|
7557
7556
|
puts '-[√] 제목 code 4.......'.yellow
|
7558
7557
|
rescue
|
7559
7558
|
begin
|
7560
7559
|
target_element = @driver.find_element(:xpath, '//*[@id="wr_title"]')
|
7561
|
-
|
7560
|
+
@driver.find_element(:xpath, '//*[@id="wr_title"]').click
|
7562
7561
|
sleep(1)
|
7563
|
-
|
7562
|
+
@driver.find_element(:xpath, '//*[@id="wr_title"]').send_keys(title)
|
7564
7563
|
puts '-[√] 제목 code 5.......'.yellow
|
7565
7564
|
rescue
|
7566
7565
|
begin
|
7567
7566
|
target_element = @driver.find_element(:xpath, '//*[@id="title"]')
|
7568
|
-
|
7567
|
+
@driver.find_element(:xpath, '//*[@id="title"]').click
|
7569
7568
|
sleep(1)
|
7570
|
-
|
7569
|
+
@driver.find_element(:xpath, '//*[@id="title"]').send_keys(title)
|
7571
7570
|
puts '-[√] 제목 code 6.......'.yellow
|
7572
7571
|
rescue
|
7573
7572
|
begin
|
7574
7573
|
target_element = @driver.find_element(:xpath, '//*[@id="postTitle"]')
|
7575
|
-
|
7574
|
+
@driver.find_element(:xpath, '//*[@id="postTitle"]').click
|
7576
7575
|
sleep(1)
|
7577
|
-
|
7576
|
+
@driver.find_element(:xpath, '//*[@id="postTitle"]').send_keys(title)
|
7578
7577
|
puts '-[√] 제목 code 7.......'.yellow
|
7579
7578
|
rescue
|
7580
7579
|
begin
|
7581
7580
|
target_element = @driver.find_element(:xpath, '//*[@title="input"]')
|
7582
|
-
|
7581
|
+
@driver.find_element(:xpath, '//*[@title="input"]').click
|
7583
7582
|
sleep(1)
|
7584
|
-
|
7583
|
+
@driver.find_element(:xpath, '//*[@title="input"]').send_keys(title)
|
7585
7584
|
puts '-[√] 제목 code 8.......'.yellow
|
7586
7585
|
rescue
|
7587
7586
|
begin
|
7588
7587
|
target_element = @driver.find_element(:xpath, '//*[@name="wr_subject"]')
|
7589
|
-
|
7588
|
+
@driver.find_element(:xpath, '//*[@name="wr_subject"]').click
|
7590
7589
|
sleep(1)
|
7591
|
-
|
7590
|
+
@driver.find_element(:xpath, '//*[@name="wr_subject"]').send_keys(title)
|
7592
7591
|
puts '-[√] 제목 code 9.......'.yellow
|
7593
7592
|
rescue
|
7594
7593
|
begin
|
7595
7594
|
target_element = @driver.find_element(:xpath, '//*[@name="post_title"]')
|
7596
|
-
|
7595
|
+
@driver.find_element(:xpath, '//*[@name="post_title"]').click
|
7597
7596
|
sleep(1)
|
7598
|
-
|
7597
|
+
@driver.find_element(:xpath, '//*[@name="post_title"]').send_keys(title)
|
7599
7598
|
puts '-[√] 제목 code 11.......'.yellow
|
7600
7599
|
rescue
|
7601
7600
|
begin
|
7602
7601
|
target_element = @driver.find_element(:xpath, '//*[@title="제목"]')
|
7603
|
-
|
7602
|
+
@driver.find_element(:xpath, '//*[@title="제목"]').click
|
7604
7603
|
sleep(1)
|
7605
|
-
|
7604
|
+
@driver.find_element(:xpath, '//*[@title="제목"]').send_keys(title)
|
7606
7605
|
puts '-[√] 제목 code 12.......'.yellow
|
7607
7606
|
rescue
|
7608
7607
|
begin
|
7609
7608
|
target_element = @driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요"]')
|
7610
|
-
|
7609
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요"]').click
|
7611
7610
|
sleep(1)
|
7612
|
-
|
7611
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요"]').send_keys(title)
|
7613
7612
|
puts '-[√] 제목 code 13.......'.yellow
|
7614
7613
|
rescue
|
7615
7614
|
begin
|
7616
7615
|
target_element = @driver.find_element(:xpath, '//*[@placeholder="제목"]')
|
7617
|
-
|
7616
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목"]').click
|
7618
7617
|
sleep(1)
|
7619
|
-
|
7618
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목"]').send_keys(title)
|
7620
7619
|
puts '-[√] 제목 code 14.......'.yellow
|
7621
7620
|
rescue
|
7622
7621
|
begin
|
7623
7622
|
target_element = @driver.find_element(:xpath, '//*[@hname="제목"]')
|
7624
|
-
|
7623
|
+
@driver.find_element(:xpath, '//*[@hname="제목"]').click
|
7625
7624
|
sleep(1)
|
7626
|
-
|
7625
|
+
@driver.find_element(:xpath, '//*[@hname="제목"]').send_keys(title)
|
7627
7626
|
puts '-[√] 제목 code 15.......'.yellow
|
7628
7627
|
rescue
|
7629
7628
|
begin
|
7630
7629
|
target_element = @driver.find_element(:xpath, '//*[@id="post_subject"]')
|
7631
|
-
|
7630
|
+
@driver.find_element(:xpath, '//*[@id="post_subject"]').click
|
7632
7631
|
sleep(1)
|
7633
|
-
|
7632
|
+
@driver.find_element(:xpath, '//*[@id="post_subject"]').send_keys(title)
|
7634
7633
|
puts '-[√] 제목 code 16.......'.yellow
|
7635
7634
|
rescue
|
7636
7635
|
begin
|
7637
7636
|
target_element = @driver.find_element(:xpath, '//*[@id="search_bar"]')
|
7638
|
-
|
7637
|
+
@driver.find_element(:xpath, '//*[@id="search_bar"]').click
|
7639
7638
|
sleep(1)
|
7640
|
-
|
7639
|
+
@driver.find_element(:xpath, '//*[@id="search_bar"]').send_keys(title)
|
7641
7640
|
puts '-[√] 제목 code 17.......'.yellow
|
7642
7641
|
rescue
|
7643
7642
|
begin
|
7644
7643
|
target_element = @driver.find_element(:xpath, '//*[@for="wr_subject"]')
|
7645
|
-
|
7644
|
+
@driver.find_element(:xpath, '//*[@for="wr_subject"]').click
|
7646
7645
|
sleep(1)
|
7647
|
-
|
7646
|
+
@driver.find_element(:xpath, '//*[@for="wr_subject"]').send_keys(title)
|
7648
7647
|
puts '-[√] 제목 code 18.......'.yellow
|
7649
7648
|
|
7650
7649
|
rescue
|
@@ -7652,127 +7651,119 @@ rescue
|
|
7652
7651
|
begin
|
7653
7652
|
|
7654
7653
|
target_element = @driver.find_element(:xpath, '//*[@id="wr_subject"]')
|
7655
|
-
|
7654
|
+
@driver.find_element(:xpath, '//*[@id="wr_subject"]').send_keys(title)
|
7656
7655
|
sleep(1)
|
7657
|
-
target_element.send_keys(title)
|
7658
7656
|
puts '-[√] 제목 code 19.......'.yellow
|
7659
7657
|
rescue
|
7660
7658
|
begin
|
7661
7659
|
|
7662
7660
|
target_element = @driver.find_element(:xpath, '//*[@fw-label="제목"]')
|
7663
|
-
|
7661
|
+
@driver.find_element(:xpath, '//*[@fw-label="제목"]').send_keys(title)
|
7664
7662
|
sleep(1)
|
7665
|
-
target_element.send_keys(title)
|
7666
7663
|
puts '-[√] 제목 code 20.......'.yellow
|
7667
7664
|
rescue
|
7668
7665
|
begin
|
7669
7666
|
|
7670
7667
|
target_element = @driver.find_element(:xpath, '//*[@name="subject"]')
|
7671
|
-
|
7668
|
+
@driver.find_element(:xpath, '//*[@name="subject"]').send_keys(title)
|
7672
7669
|
sleep(1)
|
7673
|
-
target_element.send_keys(title)
|
7674
7670
|
puts '-[√] 제목 code 21.......'.yellow
|
7675
7671
|
rescue
|
7676
7672
|
begin
|
7677
7673
|
|
7678
|
-
target_element = @driver.find_element(:xpath, '
|
7679
|
-
|
7674
|
+
target_element = @driver.find_element(:xpath, '//label[@for="subject" and contains(@class, "i_label")]')
|
7675
|
+
@driver.find_element(:xpath, '//label[@for="subject" and contains(@class, "i_label")]').send_keys(title)
|
7676
|
+
sleep(1)
|
7677
|
+
puts '-[√] 제목 code 21-1.......'.yellow
|
7678
|
+
rescue
|
7679
|
+
begin
|
7680
|
+
|
7681
|
+
target_element = @driver.find_element(:xpath, '//*[@name="title"]')
|
7682
|
+
@driver.find_element(:xpath, '//*[@name="title"]').send_keys(title)
|
7680
7683
|
sleep(1)
|
7681
|
-
target_element.send_keys(title)
|
7682
7684
|
puts '-[√] 제목 code 22.......'.yellow
|
7683
7685
|
rescue
|
7684
7686
|
begin
|
7685
7687
|
|
7686
7688
|
target_element = @driver.find_element(:xpath, '//*[@id="wr_title"]')
|
7687
|
-
|
7689
|
+
@driver.find_element(:xpath, '//*[@id="wr_title"]').send_keys(title)
|
7688
7690
|
sleep(1)
|
7689
|
-
target_element.send_keys(title)
|
7690
7691
|
puts '-[√] 제목 code 23.......'.yellow
|
7691
7692
|
rescue
|
7692
7693
|
begin
|
7693
7694
|
|
7694
|
-
target_element = @driver.find_element(:xpath, '//*[@id="title"]')
|
7695
|
-
|
7695
|
+
target_element = @driver.find_element(:xpath, '//*[@id="title"]')
|
7696
|
+
@driver.find_element(:xpath, '//*[@id="title"]').send_keys(title)
|
7696
7697
|
sleep(1)
|
7697
|
-
target_element.send_keys(title)
|
7698
7698
|
puts '-[√] 제목 code 24.......'.yellow
|
7699
7699
|
rescue
|
7700
7700
|
begin
|
7701
7701
|
|
7702
7702
|
target_element = @driver.find_element(:xpath, '//*[@id="postTitle"]')
|
7703
|
-
|
7703
|
+
@driver.find_element(:xpath, '//*[@id="postTitle"]').send_keys(title)
|
7704
7704
|
sleep(1)
|
7705
|
-
target_element.send_keys(title)
|
7706
7705
|
puts '-[√] 제목 code 25.......'.yellow
|
7707
7706
|
rescue
|
7708
7707
|
begin
|
7709
7708
|
|
7710
7709
|
target_element = @driver.find_element(:xpath, '//*[@title="input"]')
|
7711
|
-
|
7710
|
+
@driver.find_element(:xpath, '//*[@title="input"]').send_keys(title)
|
7712
7711
|
sleep(1)
|
7713
|
-
target_element.send_keys(title)
|
7714
7712
|
puts '-[√] 제목 code 26.......'.yellow
|
7715
7713
|
rescue
|
7716
7714
|
begin
|
7717
7715
|
|
7718
7716
|
target_element = @driver.find_element(:xpath, '//*[@name="wr_subject"]')
|
7719
|
-
|
7717
|
+
@driver.find_element(:xpath, '//*[@name="wr_subject"]').send_keys(title)
|
7720
7718
|
sleep(1)
|
7721
|
-
target_element.send_keys(title)
|
7722
7719
|
puts '-[√] 제목 code 27.......'.yellow
|
7723
7720
|
rescue
|
7724
7721
|
begin
|
7725
7722
|
|
7726
7723
|
target_element = @driver.find_element(:xpath, '//*[@name="post_title"]')
|
7727
|
-
|
7724
|
+
@driver.find_element(:xpath, '//*[@name="post_title"]').send_keys(title)
|
7728
7725
|
sleep(1)
|
7729
|
-
target_element.send_keys(title)
|
7730
7726
|
puts '-[√] 제목 code 28.......'.yellow
|
7731
7727
|
rescue
|
7732
7728
|
begin
|
7733
7729
|
|
7734
7730
|
target_element = @driver.find_element(:xpath, '//*[@title="제목"]')
|
7735
|
-
|
7731
|
+
@driver.find_element(:xpath, '//*[@title="제목"]').send_keys(title)
|
7736
7732
|
sleep(1)
|
7737
|
-
target_element.send_keys(title)
|
7738
7733
|
puts '-[√] 제목 code 29.......'.yellow
|
7739
7734
|
rescue
|
7740
7735
|
begin
|
7741
7736
|
|
7742
7737
|
target_element = @driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요"]')
|
7743
|
-
|
7738
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요"]').send_keys(title)
|
7744
7739
|
sleep(1)
|
7745
|
-
target_element.send_keys(title)
|
7746
7740
|
puts '-[√] 제목 code 30.......'.yellow
|
7747
7741
|
rescue
|
7748
7742
|
begin
|
7749
7743
|
|
7750
7744
|
target_element = @driver.find_element(:xpath, '//*[@placeholder="제목"]')
|
7751
|
-
|
7745
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목"]').send_keys(title)
|
7752
7746
|
sleep(1)
|
7753
|
-
target_element.send_keys(title)
|
7754
7747
|
puts '-[√] 제목 code 31.......'.yellow
|
7755
7748
|
rescue
|
7756
7749
|
begin
|
7757
7750
|
|
7758
7751
|
target_element = @driver.find_element(:xpath, '//*[@hname="제목"]')
|
7759
|
-
|
7752
|
+
@driver.find_element(:xpath, '//*[@hname="제목"]').send_keys(title)
|
7760
7753
|
sleep(1)
|
7761
|
-
target_element.send_keys(title)
|
7762
7754
|
puts '-[√] 제목 code 32.......'.yellow
|
7763
7755
|
rescue
|
7764
7756
|
begin
|
7765
7757
|
|
7766
7758
|
target_element = @driver.find_element(:xpath, '//*[@id="post_subject"]')
|
7767
|
-
|
7759
|
+
driver.find_element(:xpath, '//*[@id="post_subject"]').send_keys(title)
|
7768
7760
|
sleep(1)
|
7769
|
-
target_element.send_keys(title)
|
7770
7761
|
puts '-[√] 제목 code 33.......'.yellow
|
7771
7762
|
rescue
|
7772
7763
|
begin
|
7773
7764
|
|
7774
7765
|
target_element = @driver.find_element(:xpath, '//*[@id="search_bar"]')
|
7775
|
-
|
7766
|
+
@driver.find_element(:xpath, '//*[@id="search_bar"]').send_keys(title)
|
7776
7767
|
sleep(1)
|
7777
7768
|
target_element.send_keys(title)
|
7778
7769
|
puts '-[√] 제목 code 34.......'.yellow
|
@@ -7780,18 +7771,15 @@ rescue
|
|
7780
7771
|
begin
|
7781
7772
|
|
7782
7773
|
target_element = @driver.find_element(:xpath, '//*[@for="wr_subject"]')
|
7783
|
-
|
7774
|
+
@driver.find_element(:xpath, '//*[@for="wr_subject"]').send_keys(title)
|
7784
7775
|
sleep(1)
|
7785
|
-
target_element.send_keys(title)
|
7786
7776
|
puts '-[√] 제목 code 35.......'.yellow
|
7787
7777
|
|
7788
7778
|
rescue
|
7789
7779
|
begin
|
7790
7780
|
|
7791
7781
|
target_element = @driver.find_element(:xpath, '//*[@name="SUBJECT"]')
|
7792
|
-
|
7793
|
-
sleep(1)
|
7794
|
-
target_element.send_keys(title)
|
7782
|
+
@driver.find_element(:xpath, '//*[@name="SUBJECT"]').send_keys(title)
|
7795
7783
|
sleep(1)
|
7796
7784
|
@driver.action.key_down(:tab).key_up(:tab).perform #x탭
|
7797
7785
|
puts '-[√] 제목 code 36.......'.yellow
|
@@ -7800,99 +7788,91 @@ rescue
|
|
7800
7788
|
begin
|
7801
7789
|
|
7802
7790
|
target_element = @driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요."]')
|
7803
|
-
|
7804
|
-
sleep(1)
|
7805
|
-
target_element.send_keys(title)
|
7791
|
+
@driver.find_element(:xpath, '//*[@placeholder="제목을 입력하세요."]').send_keys(title)
|
7806
7792
|
sleep(1)
|
7807
7793
|
puts '-[√] 제목 code 37.......'.yellow
|
7808
7794
|
|
7809
7795
|
|
7810
|
-
|
7811
|
-
|
7812
7796
|
rescue
|
7813
7797
|
begin
|
7814
7798
|
|
7815
7799
|
target_element = @driver.find_element(:xpath, '//*[@id="sj"]')
|
7816
|
-
|
7817
|
-
sleep(1)
|
7818
|
-
target_element.send_keys(title)
|
7800
|
+
@driver.find_element(:xpath, '//*[@id="sj"]').send_keys(title)
|
7819
7801
|
sleep(1)
|
7820
7802
|
puts '-[√] 제목 code 38.......'.yellow
|
7821
7803
|
rescue
|
7822
7804
|
begin
|
7823
7805
|
|
7824
7806
|
target_element = @driver.find_element(:xpath, '//*[@class="i_text wid02"]')
|
7825
|
-
|
7826
|
-
sleep(1)
|
7827
|
-
target_element.send_keys(title)
|
7807
|
+
@driver.find_element(:xpath, '//*[@class="i_text wid02"]').send_keys(title)
|
7828
7808
|
sleep(1)
|
7829
7809
|
puts '-[√] 제목 code 39.......'.yellow
|
7830
7810
|
rescue
|
7831
7811
|
begin
|
7832
7812
|
|
7833
7813
|
target_element = @driver.find_element(:xpath, '//*[@name="rg_title"]')
|
7834
|
-
|
7835
|
-
sleep(1)
|
7836
|
-
target_element.send_keys(title)
|
7814
|
+
@driver.find_element(:xpath, '//*[@name="rg_title"]').send_keys(title)
|
7837
7815
|
sleep(1)
|
7838
7816
|
puts '-[√] 제목 code 40.......'.yellow
|
7839
7817
|
rescue
|
7840
7818
|
begin
|
7841
7819
|
|
7842
7820
|
target_element = @driver.find_element(:css, 'input[@name="title"]')
|
7843
|
-
|
7844
|
-
sleep(1)
|
7845
|
-
target_element.send_keys(title)
|
7821
|
+
@driver.find_element(:css, 'input[@name="title"]').send_keys(title)
|
7846
7822
|
sleep(1)
|
7847
7823
|
puts '-[√] 제목 code 41.......'.yellow
|
7848
7824
|
rescue
|
7849
7825
|
begin
|
7850
7826
|
target_element = @driver.find_element(:xpath, '//*[@id="fm_title"]')
|
7851
|
-
|
7852
|
-
sleep(1)
|
7853
|
-
target_element.send_keys(title)
|
7827
|
+
@driver.find_element(:xpath, '//*[@id="fm_title"]').send_keys(title)
|
7854
7828
|
sleep(1)
|
7855
7829
|
puts '-[√] 제목 code 42.......'.yellow
|
7856
7830
|
rescue
|
7857
7831
|
begin
|
7858
7832
|
target_element = @driver.find_element(:xpath, '//*[@id="mb_review_i_title"]')
|
7859
|
-
|
7860
|
-
sleep(1)
|
7861
|
-
target_element.send_keys(title)
|
7833
|
+
@driver.find_element(:xpath, '//*[@id="mb_review_i_title"]').send_keys(title)
|
7862
7834
|
sleep(1)
|
7863
7835
|
puts '-[√] 제목 code 43.......'.yellow
|
7864
7836
|
rescue
|
7865
7837
|
begin
|
7866
7838
|
target_element = @driver.find_element(:xpath, '//*[@name="b_subject"]')
|
7867
|
-
|
7868
|
-
sleep(1)
|
7869
|
-
target_element.send_keys(title)
|
7839
|
+
@driver.find_element(:xpath, '//*[@name="b_subject"]').send_keys(title)
|
7870
7840
|
sleep(1)
|
7871
7841
|
puts '-[√] 제목 code 44.......'.yellow
|
7872
7842
|
rescue
|
7873
7843
|
begin
|
7874
7844
|
target_element = @driver.find_element(:xpath, '//*[@name="board_subject"]')
|
7875
|
-
|
7876
|
-
sleep(1)
|
7877
|
-
target_element.send_keys(title)
|
7845
|
+
@driver.find_element(:xpath, '//*[@name="board_subject"]').send_keys(title)
|
7878
7846
|
sleep(1)
|
7879
7847
|
puts '-[√] 제목 code 45.......'.yellow
|
7880
7848
|
rescue
|
7881
7849
|
begin
|
7882
7850
|
target_element = @driver.find_element(:xpath, '//*[@name="tx_article_title"]')
|
7883
|
-
|
7884
|
-
sleep(1)
|
7885
|
-
target_element.send_keys(title)
|
7851
|
+
@driver.find_element(:xpath, '//*[@name="tx_article_title"]').send_keys(title)
|
7886
7852
|
sleep(1)
|
7887
7853
|
puts '-[√] 제목 code 46.......'.yellow
|
7854
|
+
rescue
|
7855
|
+
begin
|
7856
|
+
target_element = @driver.find_element(:xpath, '//*[@data-valid-title="제목"]')
|
7857
|
+
@driver.find_element(:xpath, '//*[@data-valid-title="제목"]').send_keys(title)
|
7858
|
+
sleep(1)
|
7859
|
+
puts '-[√] 제목 code 47.......'.yellow
|
7860
|
+
rescue
|
7861
|
+
begin
|
7862
|
+
#클릭 안될때 자바로 강제 클릭 시도 하기
|
7863
|
+
target_element = @driver.find_element(:xpath, '//input[@name="title" and @type="text"]')
|
7864
|
+
@driver.execute_script("arguments[0].scrollIntoView(true);", target_element)
|
7865
|
+
sleep(1)
|
7866
|
+
@driver.execute_script("arguments[0].click();", target_element) # 클릭 (JS)
|
7867
|
+
target_element.send_keys(title) # 텍스트 입력
|
7868
|
+
sleep(1)
|
7869
|
+
puts '-[√] 제목 code 48.......'.yellow
|
7888
7870
|
rescue
|
7889
7871
|
begin
|
7890
7872
|
target_element = @driver.find_element(:xpath, '//*[@id="csTitle"]')
|
7891
|
-
|
7892
|
-
sleep(1)
|
7893
|
-
target_element.send_keys(title)
|
7873
|
+
@driver.find_element(:xpath, '//*[@id="csTitle"]').send_keys(title)
|
7894
7874
|
sleep(1)
|
7895
|
-
puts '-[√] 제목 code
|
7875
|
+
puts '-[√] 제목 code 49.......'.yellow
|
7896
7876
|
rescue => e
|
7897
7877
|
puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
|
7898
7878
|
puts '-[√] 다음 작업 준비 중으로 1~60 초 정도 기다려주세요.......'.red
|
@@ -7913,6 +7893,9 @@ target_element.send_keys(title)
|
|
7913
7893
|
return 0
|
7914
7894
|
sleep(1)
|
7915
7895
|
end
|
7896
|
+
end
|
7897
|
+
end
|
7898
|
+
end
|
7916
7899
|
end
|
7917
7900
|
end
|
7918
7901
|
end
|
@@ -7920,6 +7903,7 @@ end
|
|
7920
7903
|
end
|
7921
7904
|
end
|
7922
7905
|
end
|
7906
|
+
end
|
7923
7907
|
end
|
7924
7908
|
end
|
7925
7909
|
end
|
@@ -8030,7 +8014,6 @@ end
|
|
8030
8014
|
@driver.find_element(:xpath, '//*[@alt="코드"]').click
|
8031
8015
|
rescue
|
8032
8016
|
begin
|
8033
|
-
|
8034
8017
|
html_bb = @driver.find_element(:xpath, '//*[@title="HTML 편집기"]')
|
8035
8018
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
|
8036
8019
|
puts '-[√] HTML 코드 8 code.......'.yellow
|
@@ -8038,7 +8021,6 @@ end
|
|
8038
8021
|
@driver.find_element(:xpath, '//*[@title="HTML 편집기"]').click
|
8039
8022
|
rescue
|
8040
8023
|
begin
|
8041
|
-
|
8042
8024
|
html_bb = @driver.find_element(:xpath, '//*[@name="tag"]')
|
8043
8025
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
|
8044
8026
|
puts '-[√] HTML 코드 9 code.......'.yellow
|
@@ -8264,33 +8246,48 @@ end
|
|
8264
8246
|
sleep(1)
|
8265
8247
|
rescue
|
8266
8248
|
begin
|
8267
|
-
|
8268
|
-
|
8269
|
-
|
8270
|
-
|
8271
|
-
|
8272
|
-
|
8273
|
-
</div>
|
8274
|
-
HTML
|
8275
|
-
@driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
|
8276
|
-
puts '체크박스 HTML 강제 적용.......'.green
|
8249
|
+
# 1. 첫 번째 iframe (id="namoIframe0") 진입
|
8250
|
+
@driver.switch_to.frame(@driver.find_element(:id, 'namoIframe0'))
|
8251
|
+
# 2. 두 번째 iframe (id="NamoSE_Ifr__namo0") 진입
|
8252
|
+
@driver.switch_to.frame(@driver.find_element(:id, 'NamoSE_Ifr__namo0'))
|
8253
|
+
html_bb = @driver.find_element(:xpath, '//*[@data-button-id="html"]')
|
8254
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
|
8277
8255
|
sleep(1)
|
8278
|
-
|
8279
|
-
|
8280
|
-
|
8281
|
-
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
|
8282
|
-
sleep(1)
|
8283
|
-
|
8284
|
-
# 5. HTML 토글 버튼 클릭
|
8285
|
-
@driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
|
8286
|
-
puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
|
8256
|
+
@driver.find_element(:xpath, '//*[@data-button-id="html"]').click
|
8257
|
+
@driver.switch_to.default_content
|
8258
|
+
puts '-[√] HTML 코드 33 code.......'.yellow
|
8287
8259
|
sleep(1)
|
8288
|
-
|
8289
|
-
else
|
8290
|
-
puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
|
8291
|
-
end
|
8292
8260
|
rescue
|
8293
|
-
|
8261
|
+
begin
|
8262
|
+
@driver.switch_to.default_content
|
8263
|
+
if target_element
|
8264
|
+
# 3. 제목 요소 바로 아래에 체크박스 HTML 삽입
|
8265
|
+
checkbox_html = <<~HTML
|
8266
|
+
<div class="custom-control custom-checkbox custom-control-inline">
|
8267
|
+
<input type="checkbox" name="html" value="html2" id="html" onclick="html_auto_br(this);" class="custom-control-input">
|
8268
|
+
<label class="custom-control-label" for="html"><span>HTML</span></label>
|
8269
|
+
</div>
|
8270
|
+
HTML
|
8271
|
+
@driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
|
8272
|
+
puts '체크박스 HTML 강제 적용.......'.green
|
8273
|
+
sleep(1)
|
8274
|
+
|
8275
|
+
# 4. 삽입한 체크박스 스크롤하여 화면 중앙으로 이동
|
8276
|
+
html_checkbox = @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]')
|
8277
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
|
8278
|
+
sleep(1)
|
8279
|
+
|
8280
|
+
# 5. HTML 토글 버튼 클릭
|
8281
|
+
@driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
|
8282
|
+
puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
|
8283
|
+
sleep(1)
|
8284
|
+
|
8285
|
+
else
|
8286
|
+
puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
|
8287
|
+
end
|
8288
|
+
rescue
|
8289
|
+
|
8290
|
+
end
|
8294
8291
|
end
|
8295
8292
|
end
|
8296
8293
|
end
|
@@ -8398,11 +8395,15 @@ begin
|
|
8398
8395
|
#아이프레임 나오기
|
8399
8396
|
@driver.switch_to.default_content()
|
8400
8397
|
sleep(1)
|
8401
|
-
puts '내용 항목 코드 타겟 7.......'.red
|
8398
|
+
puts '내용 항목 코드 타겟 7-1.......'.red
|
8402
8399
|
rescue
|
8403
8400
|
begin
|
8401
|
+
@driver.find_element(:xpath, "//textarea[@name='board_body' and contains(@class, 'inputbox_')]").click
|
8402
|
+
puts '내용 항목 코드 타겟 7-2.......'.red
|
8403
|
+
rescue
|
8404
|
+
begin
|
8404
8405
|
#아이프레임에서 코드 선택
|
8405
|
-
@driver.switch_to.frame(@driver.find_element(:xpath, '
|
8406
|
+
@driver.switch_to.frame(@driver.find_element(:xpath, '//iframe[@scrolling="no"]'))
|
8406
8407
|
@driver.find_element(:xpath, '/html').click
|
8407
8408
|
#아이프레임 나오기
|
8408
8409
|
@driver.switch_to.default_content()
|
@@ -8628,6 +8629,7 @@ sleep(1)
|
|
8628
8629
|
puts '내용 항목 코드 타겟 49.......'.red
|
8629
8630
|
rescue
|
8630
8631
|
begin
|
8632
|
+
@driver.switch_to.default_content
|
8631
8633
|
@driver.find_element(:xpath, '//*[@name="board_body"]').click
|
8632
8634
|
sleep(1)
|
8633
8635
|
puts '내용 항목 코드 타겟 50.......'.red
|
@@ -8643,6 +8645,22 @@ textarea = @driver.find_element(:id, 'kboard_content')
|
|
8643
8645
|
@driver.find_element(:id, 'kboard_content').click
|
8644
8646
|
puts '내용 항목 코드 타겟 52.......'.red
|
8645
8647
|
rescue
|
8648
|
+
begin
|
8649
|
+
@driver.find_element(xpath: "//pre[contains(@class, 'CodeMirror-line')]").click
|
8650
|
+
puts '내용 항목 코드 타겟 53.......'.red
|
8651
|
+
rescue
|
8652
|
+
begin
|
8653
|
+
# 1. 첫 번째 iframe (id="namoIframe0") 진입
|
8654
|
+
@driver.switch_to.frame(@driver.find_element(:id, 'namoIframe0'))
|
8655
|
+
# 2. 두 번째 iframe (id="NamoSE_Ifr__namo0") 진입
|
8656
|
+
@driver.switch_to.frame(@driver.find_element(:id, 'NamoSE_Ifr__namo0'))
|
8657
|
+
@driver.find_element(id: 'NamoSE_editorshtml_namo0').click
|
8658
|
+
puts '내용 항목 코드 타겟 54.......'.red
|
8659
|
+
@driver.switch_to.default_content
|
8660
|
+
rescue
|
8661
|
+
end
|
8662
|
+
end
|
8663
|
+
end
|
8646
8664
|
end
|
8647
8665
|
end
|
8648
8666
|
end
|
@@ -8728,7 +8746,10 @@ end
|
|
8728
8746
|
Clipboard.copy(content)
|
8729
8747
|
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform #새로넣은 코드 (내용 한번에 복붙방식)
|
8730
8748
|
#내용 입력<<─────────────────────────────────────────────────────────────────────
|
8731
|
-
|
8749
|
+
begin
|
8750
|
+
@driver.switch_to.default_content
|
8751
|
+
rescue
|
8752
|
+
end
|
8732
8753
|
|
8733
8754
|
begin
|
8734
8755
|
@driver.execute_script("document.body.insertAdjacentHTML('beforeend', arguments[0]);", original_html)
|
@@ -9687,7 +9708,10 @@ else
|
|
9687
9708
|
end
|
9688
9709
|
sleep(1)
|
9689
9710
|
end
|
9690
|
-
|
9711
|
+
begin
|
9712
|
+
@driver.switch_to.default_content
|
9713
|
+
rescue
|
9714
|
+
end
|
9691
9715
|
#없어도 되는 캡챠 삭제
|
9692
9716
|
begin
|
9693
9717
|
chat_box = @driver.find_element(:xpath, '//*[@id="mb_main_tr_kcaptcha_img"]')
|
@@ -9708,6 +9732,16 @@ rescue
|
|
9708
9732
|
end
|
9709
9733
|
end
|
9710
9734
|
|
9735
|
+
begin
|
9736
|
+
# 우 클릭 해제
|
9737
|
+
@driver.execute_script <<~JS
|
9738
|
+
window.alert = function() {};
|
9739
|
+
document.addEventListener('contextmenu', event => event.stopPropagation(), true);
|
9740
|
+
document.oncontextmenu = null;
|
9741
|
+
document.body.oncontextmenu = null;
|
9742
|
+
JS
|
9743
|
+
rescue
|
9744
|
+
end
|
9711
9745
|
|
9712
9746
|
begin
|
9713
9747
|
@driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]')
|
@@ -9831,6 +9865,8 @@ if check_captcha == 0
|
|
9831
9865
|
sleep(1)
|
9832
9866
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
9833
9867
|
sleep(1)
|
9868
|
+
@driver.execute_script("arguments[0].click();", el)
|
9869
|
+
sleep(1)
|
9834
9870
|
mouse_move_percentage(0.3,0.02)
|
9835
9871
|
sleep(0.5)
|
9836
9872
|
left_click
|
@@ -9852,6 +9888,8 @@ if check_captcha == 0
|
|
9852
9888
|
sleep(1)
|
9853
9889
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
9854
9890
|
sleep(1)
|
9891
|
+
@driver.execute_script("arguments[0].click();", el)
|
9892
|
+
sleep(1)
|
9855
9893
|
mouse_move_percentage(0.3,0.02)
|
9856
9894
|
sleep(0.5)
|
9857
9895
|
left_click
|
@@ -10259,7 +10297,73 @@ if check_captcha == 0
|
|
10259
10297
|
sleep(1)
|
10260
10298
|
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
10261
10299
|
rescue
|
10262
|
-
|
10300
|
+
begin
|
10301
|
+
@driver.switch_to.default_content()
|
10302
|
+
el = @driver.find_element(:xpath, '//*[@alt="스팸방지코드"]')
|
10303
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
10304
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
10305
|
+
puts '-[√] 캡챠 코드 code 20.......'.red
|
10306
|
+
sleep(1)
|
10307
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
10308
|
+
sleep(1)
|
10309
|
+
mouse_move_percentage(0.3,0.02)
|
10310
|
+
sleep(0.5)
|
10311
|
+
left_click
|
10312
|
+
sleep(1)
|
10313
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
10314
|
+
@driver.action.context_click(el).perform #우 클릭
|
10315
|
+
sleep(1)
|
10316
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
10317
|
+
sleep(1)
|
10318
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
10319
|
+
rescue
|
10320
|
+
begin
|
10321
|
+
@driver.switch_to.default_content()
|
10322
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "/cms/CaptCha.jsp")]')
|
10323
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
10324
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
10325
|
+
puts '-[√] 캡챠 코드 code 20.......'.red
|
10326
|
+
sleep(1)
|
10327
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
10328
|
+
sleep(1)
|
10329
|
+
mouse_move_percentage(0.3,0.02)
|
10330
|
+
sleep(0.5)
|
10331
|
+
left_click
|
10332
|
+
sleep(1)
|
10333
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
10334
|
+
@driver.action.context_click(el).perform #우 클릭
|
10335
|
+
sleep(1)
|
10336
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
10337
|
+
sleep(1)
|
10338
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
10339
|
+
rescue
|
10340
|
+
begin
|
10341
|
+
@driver.switch_to.default_content()
|
10342
|
+
@driver.switch_to.frame(@driver.find_element(:xpath, '//iframe[contains(@src, "spamcode.php") and @name="spamcode"]'))
|
10343
|
+
el = @driver.find_element(:xpath, "//img[contains(@src, 'spamcode.php')]")
|
10344
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
10345
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
10346
|
+
puts '-[√] 캡챠 코드 code 20.......'.red
|
10347
|
+
sleep(1)
|
10348
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
10349
|
+
sleep(1)
|
10350
|
+
mouse_move_percentage(0.3,0.02)
|
10351
|
+
sleep(0.5)
|
10352
|
+
left_click
|
10353
|
+
sleep(1)
|
10354
|
+
#@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
10355
|
+
@driver.action.context_click(el).perform #우 클릭
|
10356
|
+
sleep(1)
|
10357
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
10358
|
+
sleep(1)
|
10359
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
10360
|
+
#아이프레임 나오기
|
10361
|
+
@driver.switch_to.default_content()
|
10362
|
+
rescue
|
10363
|
+
|
10364
|
+
end
|
10365
|
+
end
|
10366
|
+
end
|
10263
10367
|
end
|
10264
10368
|
|
10265
10369
|
end
|
@@ -11221,7 +11325,133 @@ if check_captcha == 0
|
|
11221
11325
|
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11222
11326
|
sleep(1)
|
11223
11327
|
rescue
|
11328
|
+
begin
|
11329
|
+
|
11330
|
+
@driver.find_element(:xpath, '//*[@type="text" and @name="boardpwd"]').click
|
11331
|
+
sleep(1)
|
11332
|
+
el2 = @driver.find_element(:xpath, '//*[@type="text" and @name="boardpwd"]')
|
11333
|
+
@driver.action.context_click(el2).perform
|
11334
|
+
|
11335
|
+
sleep(1)
|
11336
|
+
@driver.action.key_stroke('up')
|
11337
|
+
sleep(1)
|
11338
|
+
@driver.action.key_stroke('up')
|
11339
|
+
sleep(1)
|
11340
|
+
@driver.action.key_stroke('enter')
|
11341
|
+
sleep(1)
|
11342
|
+
begin
|
11343
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11344
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11345
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11346
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11347
|
+
rescue
|
11348
|
+
sleep(1)
|
11349
|
+
@driver.action.key_stroke('left')
|
11350
|
+
sleep(1)
|
11351
|
+
@driver.action.key_stroke('up')
|
11352
|
+
sleep(1)
|
11353
|
+
@driver.action.key_stroke('enter')
|
11354
|
+
sleep(1)
|
11355
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11356
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11357
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11358
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11359
|
+
end
|
11360
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
11361
|
+
|
11362
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11363
|
+
sleep(2)
|
11364
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11365
|
+
sleep(2)
|
11366
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11367
|
+
sleep(1)
|
11368
|
+
rescue
|
11369
|
+
begin
|
11370
|
+
|
11371
|
+
@driver.find_element(:xpath, '//*[@data-valid-title="보안문자"]').click
|
11372
|
+
sleep(1)
|
11373
|
+
el2 = @driver.find_element(:xpath, '//*[@data-valid-title="보안문자"]')
|
11374
|
+
@driver.action.context_click(el2).perform
|
11375
|
+
|
11376
|
+
sleep(1)
|
11377
|
+
@driver.action.key_stroke('up')
|
11378
|
+
sleep(1)
|
11379
|
+
@driver.action.key_stroke('up')
|
11380
|
+
sleep(1)
|
11381
|
+
@driver.action.key_stroke('enter')
|
11382
|
+
sleep(1)
|
11383
|
+
begin
|
11384
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11385
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11386
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11387
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11388
|
+
rescue
|
11389
|
+
sleep(1)
|
11390
|
+
@driver.action.key_stroke('left')
|
11391
|
+
sleep(1)
|
11392
|
+
@driver.action.key_stroke('up')
|
11393
|
+
sleep(1)
|
11394
|
+
@driver.action.key_stroke('enter')
|
11395
|
+
sleep(1)
|
11396
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11397
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11398
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11399
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11400
|
+
end
|
11401
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
11402
|
+
|
11403
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11404
|
+
sleep(2)
|
11405
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11406
|
+
sleep(2)
|
11407
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11408
|
+
sleep(1)
|
11409
|
+
rescue
|
11410
|
+
begin
|
11224
11411
|
|
11412
|
+
@driver.find_element(:xpath, "//input[@type='text' and @name='spamcode_chk' and contains(@class, 'input_')]").click
|
11413
|
+
sleep(1)
|
11414
|
+
el2 = @driver.find_element(:xpath, "//input[@type='text' and @name='spamcode_chk' and contains(@class, 'input_')]")
|
11415
|
+
@driver.action.context_click(el2).perform
|
11416
|
+
|
11417
|
+
sleep(1)
|
11418
|
+
@driver.action.key_stroke('up')
|
11419
|
+
sleep(1)
|
11420
|
+
@driver.action.key_stroke('up')
|
11421
|
+
sleep(1)
|
11422
|
+
@driver.action.key_stroke('enter')
|
11423
|
+
sleep(1)
|
11424
|
+
begin
|
11425
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11426
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11427
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11428
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11429
|
+
rescue
|
11430
|
+
sleep(1)
|
11431
|
+
@driver.action.key_stroke('left')
|
11432
|
+
sleep(1)
|
11433
|
+
@driver.action.key_stroke('up')
|
11434
|
+
sleep(1)
|
11435
|
+
@driver.action.key_stroke('enter')
|
11436
|
+
sleep(1)
|
11437
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
11438
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
11439
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
11440
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
11441
|
+
end
|
11442
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
11443
|
+
|
11444
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11445
|
+
sleep(2)
|
11446
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11447
|
+
sleep(2)
|
11448
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
11449
|
+
sleep(1)
|
11450
|
+
rescue
|
11451
|
+
|
11452
|
+
end
|
11453
|
+
end
|
11454
|
+
end
|
11225
11455
|
end
|
11226
11456
|
end
|
11227
11457
|
end
|
@@ -11379,7 +11609,10 @@ sleep(1)
|
|
11379
11609
|
@driver.action.key_down(:tab).key_up(:tab).perform #x탭
|
11380
11610
|
|
11381
11611
|
|
11382
|
-
|
11612
|
+
begin
|
11613
|
+
@driver.switch_to.default_content
|
11614
|
+
rescue
|
11615
|
+
end
|
11383
11616
|
|
11384
11617
|
|
11385
11618
|
|
@@ -11416,7 +11649,10 @@ rescue
|
|
11416
11649
|
end
|
11417
11650
|
end
|
11418
11651
|
|
11419
|
-
|
11652
|
+
begin
|
11653
|
+
@driver.switch_to.default_content
|
11654
|
+
rescue
|
11655
|
+
end
|
11420
11656
|
|
11421
11657
|
##<─────────────────────────────────────────────────────────────────────캡챠 해제 입력 코드 부분
|
11422
11658
|
|
@@ -11606,7 +11842,7 @@ sleep(1)
|
|
11606
11842
|
@driver.find_element(:xpath, '//*[@form="write"]').click
|
11607
11843
|
sleep(1)
|
11608
11844
|
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
11609
|
-
puts '-[√] 등록을
|
11845
|
+
puts '-[√] 등록을 20번 코드로 시도하였습니다.......'.magenta
|
11610
11846
|
sleep(1)
|
11611
11847
|
|
11612
11848
|
rescue
|
@@ -11616,7 +11852,7 @@ ss_button = @driver.find_element(:partial_link_text, '저장하기')
|
|
11616
11852
|
sleep(1)
|
11617
11853
|
|
11618
11854
|
@driver.find_element(:partial_link_text, '저장하기').click #요소같고 텍스트가 다를때 텍스트로 타겟
|
11619
|
-
puts '-[√] 등록을
|
11855
|
+
puts '-[√] 등록을 21번 코드로 시도하였습니다.......'.magenta
|
11620
11856
|
sleep(1)
|
11621
11857
|
|
11622
11858
|
rescue
|
@@ -11626,7 +11862,7 @@ ss_button = @driver.find_element(:xpath, '//*[@id="boardWriteForm"]/div/div[3]/a
|
|
11626
11862
|
sleep(1)
|
11627
11863
|
|
11628
11864
|
@driver.find_element(:xpath, '//*[@id="boardWriteForm"]/div/div[3]/a[2]').click
|
11629
|
-
puts '-[√] 등록을
|
11865
|
+
puts '-[√] 등록을 22시도하였습니다.......'.magenta
|
11630
11866
|
sleep(1)
|
11631
11867
|
|
11632
11868
|
rescue
|
@@ -11636,7 +11872,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="btnWrite"]')
|
|
11636
11872
|
sleep(1)
|
11637
11873
|
|
11638
11874
|
@driver.find_element(:xpath, '//*[@class="btnWrite"]').click
|
11639
|
-
puts '-[√] 등록을
|
11875
|
+
puts '-[√] 등록을 23시도하였습니다.......'.magenta
|
11640
11876
|
sleep(1)
|
11641
11877
|
|
11642
11878
|
rescue
|
@@ -11646,7 +11882,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]')
|
|
11646
11882
|
sleep(1)
|
11647
11883
|
|
11648
11884
|
@driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').click
|
11649
|
-
puts '-[√] 등록을
|
11885
|
+
puts '-[√] 등록을 24번 코드로 시도하였습니다.......'.magenta
|
11650
11886
|
sleep(1)
|
11651
11887
|
|
11652
11888
|
rescue
|
@@ -11660,7 +11896,7 @@ end
|
|
11660
11896
|
sleep(1)
|
11661
11897
|
|
11662
11898
|
ss_button.click
|
11663
|
-
puts '-[√] 등록을
|
11899
|
+
puts '-[√] 등록을 25번 코드로 시도하였습니다.......'.magenta
|
11664
11900
|
sleep(1)
|
11665
11901
|
|
11666
11902
|
|
@@ -11671,7 +11907,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="button-agree"]')
|
|
11671
11907
|
sleep(1)
|
11672
11908
|
|
11673
11909
|
@driver.find_element(:xpath, '//*[@class="button-agree"]').click
|
11674
|
-
puts '-[√] 등록을
|
11910
|
+
puts '-[√] 등록을 26번 코드로 시도하였습니다.......'.magenta
|
11675
11911
|
sleep(1)
|
11676
11912
|
|
11677
11913
|
rescue
|
@@ -11681,7 +11917,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="btnSubmitFix sizeM"]')
|
|
11681
11917
|
sleep(1)
|
11682
11918
|
|
11683
11919
|
@driver.find_element(:xpath, '//*[@class="btnSubmitFix sizeM"]').click
|
11684
|
-
puts '-[√] 등록을
|
11920
|
+
puts '-[√] 등록을 27번 코드로 시도하였습니다.......'.magenta
|
11685
11921
|
sleep(1)
|
11686
11922
|
|
11687
11923
|
rescue
|
@@ -11691,7 +11927,7 @@ ss_button = @driver.find_element(:xpath, "//button[contains(text(), '글쓰기')
|
|
11691
11927
|
sleep(1)
|
11692
11928
|
|
11693
11929
|
@driver.find_element(:xpath, "//button[contains(text(), '글쓰기')]").click
|
11694
|
-
puts '-[√] 등록을
|
11930
|
+
puts '-[√] 등록을 28번 코드로 시도하였습니다.......'.magenta
|
11695
11931
|
sleep(1)
|
11696
11932
|
|
11697
11933
|
rescue
|
@@ -11701,7 +11937,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="Button button-rounded blac
|
|
11701
11937
|
sleep(1)
|
11702
11938
|
|
11703
11939
|
@driver.find_element(:xpath, '//*[@class="Button button-rounded black button-normal"]').click
|
11704
|
-
puts '-[√] 등록을
|
11940
|
+
puts '-[√] 등록을 29번 코드로 시도하였습니다.......'.magenta
|
11705
11941
|
sleep(1)
|
11706
11942
|
|
11707
11943
|
rescue
|
@@ -11711,7 +11947,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="btn btn_point"]')
|
|
11711
11947
|
sleep(1)
|
11712
11948
|
|
11713
11949
|
@driver.find_element(:xpath, '//*[@class="btn btn_point"]').click
|
11714
|
-
puts '-[√] 등록을
|
11950
|
+
puts '-[√] 등록을 30번 코드로 시도하였습니다.......'.magenta
|
11715
11951
|
sleep(1)
|
11716
11952
|
|
11717
11953
|
rescue
|
@@ -11721,7 +11957,7 @@ ss_button = @driver.find_element(:xpath, '//img[contains(@src, "save")]')
|
|
11721
11957
|
sleep(1)
|
11722
11958
|
|
11723
11959
|
ss_button = @driver.find_element(:xpath, '//img[contains(@src, "save")]').click
|
11724
|
-
puts '-[√] 등록을
|
11960
|
+
puts '-[√] 등록을 31번 코드로 시도하였습니다.......'.magenta
|
11725
11961
|
sleep(1)
|
11726
11962
|
|
11727
11963
|
rescue
|
@@ -11731,7 +11967,7 @@ ss_button = @driver.find_element(:css, 'input[@type="submit" and @value="확인"
|
|
11731
11967
|
sleep(1)
|
11732
11968
|
|
11733
11969
|
ss_button = @driver.find_element(:css, 'input[@type="submit" and @value="확인"]').click
|
11734
|
-
puts '-[√] 등록을
|
11970
|
+
puts '-[√] 등록을 32번 코드로 시도하였습니다.......'.magenta
|
11735
11971
|
sleep(1)
|
11736
11972
|
|
11737
11973
|
rescue
|
@@ -11741,7 +11977,7 @@ ss_button = @driver.find_element(:xpath, '//*[@type="button" and @value="작성"
|
|
11741
11977
|
sleep(1)
|
11742
11978
|
|
11743
11979
|
ss_button = @driver.find_element(:xpath, '//*[@type="button" and @value="작성"]').click
|
11744
|
-
puts '-[√] 등록을
|
11980
|
+
puts '-[√] 등록을 33번 코드로 시도하였습니다.......'.magenta
|
11745
11981
|
sleep(1)
|
11746
11982
|
|
11747
11983
|
rescue
|
@@ -11751,7 +11987,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="button button-inverse butt
|
|
11751
11987
|
sleep(1)
|
11752
11988
|
|
11753
11989
|
ss_button = @driver.find_element(:xpath, '//*[@class="button button-inverse button-small write_ok"]').click
|
11754
|
-
puts '-[√] 등록을
|
11990
|
+
puts '-[√] 등록을 34번 코드로 시도하였습니다.......'.magenta
|
11755
11991
|
sleep(1)
|
11756
11992
|
|
11757
11993
|
rescue
|
@@ -11761,7 +11997,7 @@ ss_button = @driver.find_element(:xpath, '//img[contains(@src, "btn/send")]')
|
|
11761
11997
|
sleep(1)
|
11762
11998
|
|
11763
11999
|
ss_button = @driver.find_element(:xpath, '//img[contains(@src, "btn/send")]').click
|
11764
|
-
puts '-[√] 등록을
|
12000
|
+
puts '-[√] 등록을 35번 코드로 시도하였습니다.......'.magenta
|
11765
12001
|
sleep(1)
|
11766
12002
|
|
11767
12003
|
rescue
|
@@ -11771,7 +12007,7 @@ ss_button = @driver.find_element(:xpath, '//input[@name="formimage1"]')
|
|
11771
12007
|
sleep(1)
|
11772
12008
|
|
11773
12009
|
ss_button = @driver.find_element(:xpath, '//input[@name="formimage1"]').click
|
11774
|
-
puts '-[√] 등록을
|
12010
|
+
puts '-[√] 등록을 36번 코드로 시도하였습니다.......'.magenta
|
11775
12011
|
sleep(1)
|
11776
12012
|
|
11777
12013
|
rescue
|
@@ -11781,7 +12017,7 @@ ss_button = @driver.find_element(:xpath, '//button[@type="button" and @class="bt
|
|
11781
12017
|
sleep(1)
|
11782
12018
|
|
11783
12019
|
ss_button = @driver.find_element(:xpath, '//button[@type="button" and @class="btnSubmit"]').click
|
11784
|
-
puts '-[√] 등록을
|
12020
|
+
puts '-[√] 등록을 37번 코드로 시도하였습니다.......'.magenta
|
11785
12021
|
sleep(1)
|
11786
12022
|
|
11787
12023
|
rescue
|
@@ -11791,7 +12027,7 @@ ss_button = @driver.find_element(:xpath, '//input[@type="button" and @value="전
|
|
11791
12027
|
sleep(1)
|
11792
12028
|
|
11793
12029
|
ss_button = @driver.find_element(:xpath, '//input[@type="button" and @value="전송"]').click
|
11794
|
-
puts '-[√] 등록을
|
12030
|
+
puts '-[√] 등록을 38번 코드로 시도하였습니다.......'.magenta
|
11795
12031
|
sleep(1)
|
11796
12032
|
|
11797
12033
|
rescue
|
@@ -11801,7 +12037,7 @@ ss_button = @driver.find_element(css: 'ul.bt_type li a.bt_type4_w_4')
|
|
11801
12037
|
sleep(1)
|
11802
12038
|
|
11803
12039
|
ss_button = @driver.find_element(css: 'ul.bt_type li a.bt_type4_w_4').click
|
11804
|
-
puts '-[√] 등록을
|
12040
|
+
puts '-[√] 등록을 39번 코드로 시도하였습니다.......'.magenta
|
11805
12041
|
sleep(1)
|
11806
12042
|
|
11807
12043
|
rescue
|
@@ -11811,7 +12047,7 @@ ss_button = @driver.find_element(id: 'btn-write')
|
|
11811
12047
|
sleep(1)
|
11812
12048
|
|
11813
12049
|
ss_button = @driver.find_element(id: 'btn-write').click
|
11814
|
-
puts '-[√] 등록을
|
12050
|
+
puts '-[√] 등록을 40번 코드로 시도하였습니다.......'.magenta
|
11815
12051
|
sleep(1)
|
11816
12052
|
|
11817
12053
|
rescue
|
@@ -11821,7 +12057,7 @@ ss_button = @driver.find_element(:xpath, '//img[contains(@src, "img/btn_confirm.
|
|
11821
12057
|
sleep(1)
|
11822
12058
|
|
11823
12059
|
ss_button = @driver.find_element(:xpath, '//img[contains(@src, "img/btn_confirm.gif")]').click
|
11824
|
-
puts '-[√] 등록을
|
12060
|
+
puts '-[√] 등록을 41번 코드로 시도하였습니다.......'.magenta
|
11825
12061
|
sleep(1)
|
11826
12062
|
|
11827
12063
|
rescue
|
@@ -11831,7 +12067,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="btn2_1"]')
|
|
11831
12067
|
sleep(1)
|
11832
12068
|
|
11833
12069
|
ss_button = @driver.find_element(:xpath, '//*[@class="btn2_1"]').click
|
11834
|
-
puts '-[√] 등록을
|
12070
|
+
puts '-[√] 등록을 42번 코드로 시도하였습니다.......'.magenta
|
11835
12071
|
sleep(1)
|
11836
12072
|
|
11837
12073
|
rescue
|
@@ -11841,7 +12077,7 @@ ss_button = @driver.find_element(:xpath, '//*[@class="pro-btn large _write"]')
|
|
11841
12077
|
sleep(1)
|
11842
12078
|
|
11843
12079
|
ss_button = @driver.find_element(:xpath, '//*[@class="pro-btn large _write"]').click
|
11844
|
-
puts '-[√] 등록을
|
12080
|
+
puts '-[√] 등록을 43번 코드로 시도하였습니다.......'.magenta
|
11845
12081
|
sleep(1)
|
11846
12082
|
|
11847
12083
|
rescue
|
@@ -11851,7 +12087,7 @@ ss_button = @driver.find_element(:xpath, '//*[@type="submit" and @name="save" an
|
|
11851
12087
|
sleep(1)
|
11852
12088
|
|
11853
12089
|
ss_button = @driver.find_element(:xpath, '//*[@type="submit" and @name="save" and @value="저장"]').click
|
11854
|
-
puts '-[√] 등록을
|
12090
|
+
puts '-[√] 등록을 44번 코드로 시도하였습니다.......'.magenta
|
11855
12091
|
sleep(1)
|
11856
12092
|
|
11857
12093
|
rescue
|
@@ -11861,7 +12097,47 @@ ss_button = @driver.find_element(:xpath, '//a[text()="확인" and @href="javascr
|
|
11861
12097
|
sleep(1)
|
11862
12098
|
|
11863
12099
|
ss_button = @driver.find_element(:xpath, '//a[text()="확인" and @href="javascript:chk();"]').click
|
11864
|
-
puts '-[√] 등록을
|
12100
|
+
puts '-[√] 등록을 45번 코드로 시도하였습니다.......'.magenta
|
12101
|
+
sleep(1)
|
12102
|
+
|
12103
|
+
rescue
|
12104
|
+
begin
|
12105
|
+
ss_button = @driver.find_element(:xpath, '//a[text()="저장" and contains(@class, "write_color_btn")]')
|
12106
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
12107
|
+
sleep(1)
|
12108
|
+
|
12109
|
+
ss_button = @driver.find_element(:xpath, '//a[text()="저장" and contains(@class, "write_color_btn")]').click
|
12110
|
+
puts '-[√] 등록을 46번 코드로 시도하였습니다.......'.magenta
|
12111
|
+
sleep(1)
|
12112
|
+
|
12113
|
+
rescue
|
12114
|
+
begin
|
12115
|
+
ss_button = @driver.find_element(:xpath, '//a[text()="저장" and contains(@class, "write_color_btn")]')
|
12116
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
12117
|
+
sleep(1)
|
12118
|
+
|
12119
|
+
ss_button = @driver.find_element(:xpath, '//button[text()[contains(., "등록")] and contains(@class, "b-btn-type01") and contains(@class, "b-btn-c-black")]').click
|
12120
|
+
puts '-[√] 등록을 47번 코드로 시도하였습니다.......'.magenta
|
12121
|
+
sleep(1)
|
12122
|
+
|
12123
|
+
rescue
|
12124
|
+
begin
|
12125
|
+
ss_button = @driver.find_element(:xpath, "//a[contains(@class, 'w2aDesign-color-btn1') and normalize-space(text())='등록']")
|
12126
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
12127
|
+
sleep(1)
|
12128
|
+
|
12129
|
+
ss_button = @driver.find_element(:xpath, "//a[contains(@class, 'w2aDesign-color-btn1') and normalize-space(text())='등록']").click
|
12130
|
+
puts '-[√] 등록을 48번 코드로 시도하였습니다.......'.magenta
|
12131
|
+
sleep(1)
|
12132
|
+
|
12133
|
+
rescue
|
12134
|
+
begin
|
12135
|
+
ss_button = @driver.find_element(:xpath, "//a[@onclick='spamChkForm()' and normalize-space(text())='저장하기']")
|
12136
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
12137
|
+
sleep(1)
|
12138
|
+
|
12139
|
+
ss_button = @driver.find_element(:xpath, "//a[@onclick='spamChkForm()' and normalize-space(text())='저장하기']").click
|
12140
|
+
puts '-[√] 등록을 49번 코드로 시도하였습니다.......'.magenta
|
11865
12141
|
sleep(1)
|
11866
12142
|
|
11867
12143
|
rescue
|
@@ -12050,6 +12326,8 @@ end
|
|
12050
12326
|
end
|
12051
12327
|
end
|
12052
12328
|
end
|
12329
|
+
end
|
12330
|
+
end
|
12053
12331
|
end
|
12054
12332
|
end
|
12055
12333
|
end
|
@@ -12068,6 +12346,8 @@ end
|
|
12068
12346
|
end
|
12069
12347
|
end
|
12070
12348
|
end
|
12349
|
+
end
|
12350
|
+
end
|
12071
12351
|
########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 2차 시도 ▲▲▲▲▲▲▲──────────────────────────────#######
|
12072
12352
|
end
|
12073
12353
|
end
|
@@ -12111,6 +12391,89 @@ end
|
|
12111
12391
|
end
|
12112
12392
|
end
|
12113
12393
|
|
12394
|
+
|
12395
|
+
begin
|
12396
|
+
# 타임아웃을 3초로 설정
|
12397
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
12398
|
+
# 요소가 나타날 때까지 30초 동안 기다립니다.
|
12399
|
+
wait.until { @driver.find_element(:xpath, '//*[@data-state="ready"]') }
|
12400
|
+
sleep(1)
|
12401
|
+
el_ready = @driver.find_element(:xpath, '//*[@data-state="ready"]')
|
12402
|
+
@driver.action.move_to(el_ready).perform
|
12403
|
+
sleep(1)
|
12404
|
+
begin
|
12405
|
+
@driver.execute_script(<<~JS)
|
12406
|
+
document.querySelectorAll('.captcha-solver[data-state="solved"]').forEach(el => el.remove());
|
12407
|
+
JS
|
12408
|
+
|
12409
|
+
puts "방해 캡차 관련 요소 제거 완료".green
|
12410
|
+
rescue
|
12411
|
+
end
|
12412
|
+
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
12413
|
+
begin
|
12414
|
+
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
12415
|
+
rescue
|
12416
|
+
begin
|
12417
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-image"]').click #캡챠우회버튼
|
12418
|
+
rescue
|
12419
|
+
begin
|
12420
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-info"]').click #캡챠우회버튼
|
12421
|
+
rescue
|
12422
|
+
begin
|
12423
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]').click #캡챠우회버튼
|
12424
|
+
rescue
|
12425
|
+
end
|
12426
|
+
end
|
12427
|
+
end
|
12428
|
+
end
|
12429
|
+
|
12430
|
+
sleep(10)
|
12431
|
+
begin
|
12432
|
+
@driver.find_element(:xpath, '//*[@data-state="error"]').click
|
12433
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
12434
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
12435
|
+
@driver.window_handles.each do |handle|
|
12436
|
+
@driver.switch_to.window(handle)
|
12437
|
+
begin
|
12438
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
12439
|
+
@driver.close
|
12440
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
12441
|
+
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
12442
|
+
end
|
12443
|
+
end
|
12444
|
+
#return 0
|
12445
|
+
@driver.quit
|
12446
|
+
sleep(1)
|
12447
|
+
return 0
|
12448
|
+
sleep(1)
|
12449
|
+
rescue
|
12450
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 150)
|
12451
|
+
|
12452
|
+
begin
|
12453
|
+
wait.until do
|
12454
|
+
begin
|
12455
|
+
# data-state="solved" 요소가 있으면 true (대기 종료)
|
12456
|
+
@driver.find_element(:xpath, '//*[@data-state="solved"]')
|
12457
|
+
true
|
12458
|
+
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
12459
|
+
# 페이지가 바뀌면 true (대기 종료)
|
12460
|
+
true
|
12461
|
+
rescue Selenium::WebDriver::Error::NoSuchElementError
|
12462
|
+
# 요소가 아직 없으면 false (계속 대기)
|
12463
|
+
false
|
12464
|
+
end
|
12465
|
+
end
|
12466
|
+
rescue Selenium::WebDriver::Error::TimeoutError
|
12467
|
+
# 150초 지나도 못 찾으면 여기로 넘어감
|
12468
|
+
end
|
12469
|
+
|
12470
|
+
puts '-[√] 캡챠 해제 완료 또는 페이지 변경 감지 → 이어서 진행 합니다.......'.green
|
12471
|
+
sleep(5)
|
12472
|
+
|
12473
|
+
end
|
12474
|
+
rescue
|
12475
|
+
end
|
12476
|
+
|
12114
12477
|
########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 ▲▲▲▲▲▲▲──────────────────────────────#######
|
12115
12478
|
########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 ▲▲▲▲▲▲▲──────────────────────────────#######
|
12116
12479
|
|