posting_zon 3.92.799 → 3.93.799
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 +1470 -607
- metadata +2 -2
data/lib/posting_zon.rb
CHANGED
@@ -20,6 +20,7 @@ require 'rainbow/refinement'
|
|
20
20
|
require 'watir'
|
21
21
|
require 'timeout'
|
22
22
|
require 'win32ole'
|
23
|
+
require 'httpclient'
|
23
24
|
include AutoClickMethods
|
24
25
|
using Rainbow
|
25
26
|
|
@@ -690,7 +691,7 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
690
691
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
691
692
|
end
|
692
693
|
end
|
693
|
-
return 0
|
694
|
+
#return 0
|
694
695
|
@driver.quit
|
695
696
|
rescue
|
696
697
|
begin
|
@@ -736,7 +737,7 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
736
737
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
737
738
|
end
|
738
739
|
end
|
739
|
-
return 0
|
740
|
+
#return 0
|
740
741
|
@driver.quit
|
741
742
|
rescue
|
742
743
|
begin
|
@@ -780,7 +781,7 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
780
781
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
781
782
|
end
|
782
783
|
end
|
783
|
-
return 0
|
784
|
+
#return 0
|
784
785
|
@driver.quit
|
785
786
|
rescue
|
786
787
|
begin
|
@@ -1053,6 +1054,117 @@ def update(user_id, user_pw, title, content, option, post_url, signup_url, login
|
|
1053
1054
|
end
|
1054
1055
|
|
1055
1056
|
|
1057
|
+
##<────────────────────────────────────────────────────────────────────────────────────────────────────────────────캡챠 체크
|
1058
|
+
##<────────────────────────────────────────────────────────────────────────────────────────────────────────────────캡챠 체크
|
1059
|
+
##<────────────────────────────────────────────────────────────────────────────────────────────────────────────────캡챠 체크
|
1060
|
+
##<────────────────────────────────────────────────────────────────────────────────────────────────────────────────캡챠 체크
|
1061
|
+
|
1062
|
+
begin
|
1063
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]')
|
1064
|
+
check_captcha = 1
|
1065
|
+
|
1066
|
+
rescue
|
1067
|
+
check_captcha = 0
|
1068
|
+
end
|
1069
|
+
|
1070
|
+
if check_captcha == 1
|
1071
|
+
begin
|
1072
|
+
# 타임아웃을 3초로 설정
|
1073
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1074
|
+
# 요소가 나타날 때까지 30초 동안 기다립니다.
|
1075
|
+
wait.until { @driver.find_element(:xpath, '//*[@data-state="ready"]') }
|
1076
|
+
sleep(1)
|
1077
|
+
el_ready = @driver.find_element(:xpath, '//*[@data-state="ready"]')
|
1078
|
+
@driver.action.move_to(el_ready).perform
|
1079
|
+
sleep(1)
|
1080
|
+
|
1081
|
+
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
1082
|
+
begin
|
1083
|
+
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
1084
|
+
rescue
|
1085
|
+
begin
|
1086
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-image"]').click #캡챠우회버튼
|
1087
|
+
rescue
|
1088
|
+
begin
|
1089
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-info"]').click #캡챠우회버튼
|
1090
|
+
rescue
|
1091
|
+
begin
|
1092
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]').click #캡챠우회버튼
|
1093
|
+
rescue
|
1094
|
+
end
|
1095
|
+
end
|
1096
|
+
end
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
|
1100
|
+
sleep(10)
|
1101
|
+
begin
|
1102
|
+
@driver.find_element(:xpath, '//*[@data-state="error"]').click
|
1103
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
1104
|
+
puts '-[√] 캡챠 해제 실패 !! API번호 및 포인트를 체크해주세요.......'.red
|
1105
|
+
@driver.window_handles.each do |handle|
|
1106
|
+
@driver.switch_to.window(handle)
|
1107
|
+
begin
|
1108
|
+
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
1109
|
+
@driver.close
|
1110
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1111
|
+
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
1112
|
+
end
|
1113
|
+
end
|
1114
|
+
#return 0
|
1115
|
+
@driver.quit
|
1116
|
+
rescue
|
1117
|
+
# 타임아웃을 77초로 설정
|
1118
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 150)
|
1119
|
+
# 요소가 나타날 때까지 100초 동안 기다립니다.
|
1120
|
+
wait.until { @driver.find_element(:xpath, '//*[@data-state="solved"]') }
|
1121
|
+
sleep(1)
|
1122
|
+
@driver.find_element(:xpath, '//*[@data-state="solved"]').click
|
1123
|
+
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다.......'.green
|
1124
|
+
sleep(5)
|
1125
|
+
begin
|
1126
|
+
@driver.find_element(:xpath, '//*[@name="user_captcha"]').click
|
1127
|
+
sleep(1)
|
1128
|
+
@driver.action.key_down(:right).key_up(:right).perform
|
1129
|
+
rescuem
|
1130
|
+
begin
|
1131
|
+
@driver.find_element(:xpath, '//*[@id="user_captcha"]').click
|
1132
|
+
sleep(1)
|
1133
|
+
@driver.action.key_down(:right).key_up(:right).perform
|
1134
|
+
rescue
|
1135
|
+
begin
|
1136
|
+
@driver.find_element(:xpath, '//*[@title="자동글쓰기방지"]').click
|
1137
|
+
sleep(1)
|
1138
|
+
@driver.action.key_down(:right).key_up(:right).perform
|
1139
|
+
rescue
|
1140
|
+
end
|
1141
|
+
end
|
1142
|
+
end
|
1143
|
+
sleep(1)
|
1144
|
+
end
|
1145
|
+
rescue
|
1146
|
+
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
begin
|
1150
|
+
#2차 확인 버튼 있을시
|
1151
|
+
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다>>.......'.green
|
1152
|
+
button = @driver.find_element(:xpath, '//input[@type="button" and @id="captch_button" and @value="확인"]')
|
1153
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", button)
|
1154
|
+
sleep(2)
|
1155
|
+
@driver.execute_script("arguments[0].click();", button)
|
1156
|
+
|
1157
|
+
begin
|
1158
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 3)
|
1159
|
+
wait.until { @driver.switch_to.alert }
|
1160
|
+
@driver.switch_to.alert.accept
|
1161
|
+
rescue
|
1162
|
+
end
|
1163
|
+
rescue
|
1164
|
+
end
|
1165
|
+
|
1166
|
+
else
|
1167
|
+
end
|
1056
1168
|
|
1057
1169
|
##<─────────────────────────────────────────────────────────────────────체크박스2 해제 입력 코드 부분
|
1058
1170
|
##<─────────────────────────────────────────────────────────────────────체크박스2 해제 입력 코드 부분
|
@@ -1793,34 +1905,16 @@ sleep(1)
|
|
1793
1905
|
puts '-[√] 캡챠 유형 탐색.......'.green
|
1794
1906
|
|
1795
1907
|
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
el = @driver.find_element(:xpath, '//*[@id="mb_kcaptcha"]')
|
1800
|
-
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1801
|
-
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1802
|
-
puts '-[√] 캡챠 코드 code 1.......'.red
|
1803
|
-
sleep(1)
|
1804
|
-
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1805
|
-
sleep(1)
|
1806
|
-
mouse_move_percentage(0.3,0.02)
|
1807
|
-
sleep(0.5)
|
1808
|
-
left_click
|
1809
|
-
sleep(1)
|
1810
|
-
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
1811
|
-
@driver.action.context_click(el).perform #우 클릭
|
1812
|
-
sleep(1)
|
1813
|
-
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
1814
|
-
sleep(1)
|
1815
|
-
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
1816
|
-
rescue
|
1908
|
+
|
1909
|
+
if check_captcha == 0
|
1910
|
+
puts'캡챠 유무 확인.......'.yellow
|
1817
1911
|
begin
|
1818
1912
|
@driver.switch_to.default_content()
|
1819
|
-
#@driver.find_element(:xpath, '//*[@
|
1820
|
-
el = @driver.find_element(:xpath, '//*[@
|
1913
|
+
#@driver.find_element(:xpath, '//*[@id="mb_kcaptcha"]')
|
1914
|
+
el = @driver.find_element(:xpath, '//*[@id="mb_kcaptcha"]')
|
1821
1915
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1822
1916
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1823
|
-
puts '-[√] 캡챠 코드 code
|
1917
|
+
puts '-[√] 캡챠 코드 code 1.......'.red
|
1824
1918
|
sleep(1)
|
1825
1919
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1826
1920
|
sleep(1)
|
@@ -1837,18 +1931,11 @@ rescue
|
|
1837
1931
|
rescue
|
1838
1932
|
begin
|
1839
1933
|
@driver.switch_to.default_content()
|
1840
|
-
|
1841
|
-
|
1842
|
-
el = @driver.find_element(:xpath, '//*[@id="captcha_img"]')
|
1934
|
+
#@driver.find_element(:xpath, '//*[@alt="자동등록방지"]')
|
1935
|
+
el = @driver.find_element(:xpath, '//*[@alt="자동등록방지"]')
|
1843
1936
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1844
1937
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1845
|
-
puts '-[√] 캡챠 코드 code
|
1846
|
-
sleep(1)
|
1847
|
-
#요소 자체 제거 하기 기능
|
1848
|
-
chat_box = @driver.find_element(:xpath, '//*[@for="captcha_key"]')
|
1849
|
-
@driver.execute_script("arguments[0].remove();", chat_box)
|
1850
|
-
sleep(1)
|
1851
|
-
|
1938
|
+
puts '-[√] 캡챠 코드 code 2.......'.red
|
1852
1939
|
sleep(1)
|
1853
1940
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1854
1941
|
sleep(1)
|
@@ -1865,11 +1952,17 @@ rescue
|
|
1865
1952
|
rescue
|
1866
1953
|
begin
|
1867
1954
|
@driver.switch_to.default_content()
|
1868
|
-
#@driver.find_element(:xpath, '//*[@id="
|
1869
|
-
el = @driver.find_element(:xpath, '//*[@id="
|
1955
|
+
#@driver.find_element(:xpath, '//*[@id="captcha_img"]').send_keys(:tab)
|
1956
|
+
el = @driver.find_element(:xpath, '//*[@id="captcha_img"]')
|
1870
1957
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1871
1958
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1872
|
-
puts '-[√] 캡챠 코드 code
|
1959
|
+
puts '-[√] 캡챠 코드 code 3.......'.red
|
1960
|
+
sleep(1)
|
1961
|
+
#요소 자체 제거 하기 기능
|
1962
|
+
chat_box = @driver.find_element(:xpath, '//*[@for="captcha_key"]')
|
1963
|
+
@driver.execute_script("arguments[0].remove();", chat_box)
|
1964
|
+
sleep(1)
|
1965
|
+
|
1873
1966
|
sleep(1)
|
1874
1967
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1875
1968
|
sleep(1)
|
@@ -1886,10 +1979,11 @@ rescue
|
|
1886
1979
|
rescue
|
1887
1980
|
begin
|
1888
1981
|
@driver.switch_to.default_content()
|
1889
|
-
|
1982
|
+
#@driver.find_element(:xpath, '//*[@id="kcaptcha"]')
|
1983
|
+
el = @driver.find_element(:xpath, '//*[@id="kcaptcha"]')
|
1890
1984
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1891
1985
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1892
|
-
puts '-[√] 캡챠 코드 code
|
1986
|
+
puts '-[√] 캡챠 코드 code 4.......'.red
|
1893
1987
|
sleep(1)
|
1894
1988
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1895
1989
|
sleep(1)
|
@@ -1903,16 +1997,13 @@ rescue
|
|
1903
1997
|
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
1904
1998
|
sleep(1)
|
1905
1999
|
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
1906
|
-
|
1907
|
-
|
1908
2000
|
rescue
|
1909
2001
|
begin
|
1910
2002
|
@driver.switch_to.default_content()
|
1911
|
-
|
1912
|
-
el = @driver.find_element(:xpath, '//*[@for="kboard-input-captcha"] img')
|
2003
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "kboard_captcha")]')
|
1913
2004
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1914
2005
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1915
|
-
puts '-[√] 캡챠 코드 code 5-
|
2006
|
+
puts '-[√] 캡챠 코드 code 5-1.......'.red
|
1916
2007
|
sleep(1)
|
1917
2008
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1918
2009
|
sleep(1)
|
@@ -1929,12 +2020,11 @@ rescue
|
|
1929
2020
|
rescue
|
1930
2021
|
begin
|
1931
2022
|
@driver.switch_to.default_content()
|
1932
|
-
|
1933
|
-
|
1934
|
-
el = @driver.find_element(:xpath, '//*[@id="captcha_Write"]')
|
2023
|
+
#@driver.find_element(:xpath, '//*[@for="kboard-input-captcha"]')
|
2024
|
+
el = @driver.find_element(:xpath, '//*[@for="kboard-input-captcha"] img')
|
1935
2025
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1936
2026
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1937
|
-
puts '-[√] 캡챠 코드 code
|
2027
|
+
puts '-[√] 캡챠 코드 code 5-2.......'.red
|
1938
2028
|
sleep(1)
|
1939
2029
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1940
2030
|
sleep(1)
|
@@ -1951,11 +2041,12 @@ rescue
|
|
1951
2041
|
rescue
|
1952
2042
|
begin
|
1953
2043
|
@driver.switch_to.default_content()
|
1954
|
-
|
1955
|
-
|
2044
|
+
sleep(1)
|
2045
|
+
#@driver.find_element(:xpath, '//*[@id="captcha_Write"]')
|
2046
|
+
el = @driver.find_element(:xpath, '//*[@id="captcha_Write"]')
|
1956
2047
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1957
2048
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1958
|
-
puts '-[√] 캡챠 코드 code
|
2049
|
+
puts '-[√] 캡챠 코드 code 6.......'.red
|
1959
2050
|
sleep(1)
|
1960
2051
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1961
2052
|
sleep(1)
|
@@ -1972,11 +2063,11 @@ rescue
|
|
1972
2063
|
rescue
|
1973
2064
|
begin
|
1974
2065
|
@driver.switch_to.default_content()
|
1975
|
-
#@driver.find_element(:xpath, '//*[@
|
1976
|
-
el = @driver.find_element(:xpath, '//*[@
|
2066
|
+
#@driver.find_element(:xpath, '//*[@image-reader="in-progress"]')
|
2067
|
+
el = @driver.find_element(:xpath, '//*[@image-reader="in-progress"]')
|
1977
2068
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1978
2069
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
1979
|
-
puts '-[√] 캡챠 코드 code
|
2070
|
+
puts '-[√] 캡챠 코드 code 7.......'.red
|
1980
2071
|
sleep(1)
|
1981
2072
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
1982
2073
|
sleep(1)
|
@@ -1993,11 +2084,10 @@ rescue
|
|
1993
2084
|
rescue
|
1994
2085
|
begin
|
1995
2086
|
@driver.switch_to.default_content()
|
1996
|
-
|
1997
|
-
el = @driver.find_element(:xpath, '//*[@id="norobot_img"]')
|
2087
|
+
el = @driver.find_element(:xpath, '//*[@id="kcaptcha_image"]')
|
1998
2088
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
1999
2089
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2000
|
-
puts '-[√] 캡챠 코드 code
|
2090
|
+
puts '-[√] 캡챠 코드 code 8.......'.red
|
2001
2091
|
sleep(1)
|
2002
2092
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2003
2093
|
sleep(1)
|
@@ -2010,14 +2100,15 @@ rescue
|
|
2010
2100
|
sleep(1)
|
2011
2101
|
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2012
2102
|
sleep(1)
|
2013
|
-
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2103
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2014
2104
|
rescue
|
2015
2105
|
begin
|
2016
2106
|
@driver.switch_to.default_content()
|
2017
|
-
|
2107
|
+
#@driver.find_element(:xpath, '//*[@id="norobot_img"]')
|
2108
|
+
el = @driver.find_element(:xpath, '//*[@id="norobot_img"]')
|
2018
2109
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2019
2110
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2020
|
-
puts '-[√] 캡챠 코드 code
|
2111
|
+
puts '-[√] 캡챠 코드 code 9.......'.red
|
2021
2112
|
sleep(1)
|
2022
2113
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2023
2114
|
sleep(1)
|
@@ -2034,10 +2125,10 @@ rescue
|
|
2034
2125
|
rescue
|
2035
2126
|
begin
|
2036
2127
|
@driver.switch_to.default_content()
|
2037
|
-
el = @driver.find_element(:xpath, '//*[@
|
2128
|
+
el = @driver.find_element(:xpath, '//*[@class="CodeImage"]')
|
2038
2129
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2039
2130
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2040
|
-
puts '-[√] 캡챠 코드 code
|
2131
|
+
puts '-[√] 캡챠 코드 code 10.......'.red
|
2041
2132
|
sleep(1)
|
2042
2133
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2043
2134
|
sleep(1)
|
@@ -2072,505 +2163,1162 @@ rescue
|
|
2072
2163
|
sleep(1)
|
2073
2164
|
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2074
2165
|
rescue
|
2075
|
-
|
2076
|
-
end
|
2077
|
-
end
|
2078
|
-
|
2079
|
-
end
|
2080
|
-
end
|
2081
|
-
end
|
2082
|
-
end
|
2083
|
-
end
|
2084
|
-
end
|
2085
|
-
end
|
2086
|
-
|
2087
|
-
end
|
2088
|
-
end
|
2089
|
-
end
|
2090
|
-
end
|
2091
|
-
##캡챠 이미지,2캡챠,,등등 코드 부분─────────────────────────────────────────────────────────────────────>
|
2092
|
-
|
2093
|
-
sleep(1)
|
2094
|
-
|
2095
|
-
##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
|
2096
|
-
puts '-[√] 캡챠 입력 항목 탐색.......'.green
|
2097
|
-
begin
|
2098
|
-
@driver.find_element(:xpath, '//*[@name="captcha_key"]').click
|
2099
|
-
|
2100
|
-
sleep(1)
|
2101
|
-
|
2102
|
-
el2 = @driver.find_element(:xpath, '//*[@name="captcha_key"]')
|
2103
|
-
@driver.action.context_click(el2).perform
|
2104
|
-
sleep(1)
|
2105
|
-
@driver.action.key_stroke('up')
|
2106
|
-
sleep(1)
|
2107
|
-
@driver.action.key_stroke('up')
|
2108
|
-
sleep(1)
|
2109
|
-
@driver.action.key_stroke('enter')
|
2110
|
-
sleep(1)
|
2111
|
-
|
2112
|
-
begin
|
2113
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2114
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2115
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2116
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2117
|
-
rescue
|
2118
|
-
sleep(1)
|
2119
|
-
@driver.action.key_stroke('left')
|
2120
|
-
sleep(1)
|
2121
|
-
@driver.action.key_stroke('up')
|
2122
|
-
sleep(1)
|
2123
|
-
@driver.action.key_stroke('enter')
|
2124
|
-
sleep(1)
|
2125
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2126
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2127
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2128
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2129
|
-
end
|
2130
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2131
|
-
sleep(1)
|
2132
|
-
rescue
|
2133
|
-
begin
|
2134
|
-
@driver.find_element(:xpath, '//*[@id="captcha_key"]').click
|
2135
|
-
|
2136
|
-
sleep(1)
|
2137
|
-
|
2138
|
-
el2 = @driver.find_element(:xpath, '//*[@id="captcha_key"]')
|
2139
|
-
@driver.action.context_click(el2).perform
|
2140
|
-
|
2141
|
-
sleep(1)
|
2142
|
-
@driver.action.key_stroke('up')
|
2143
|
-
sleep(1)
|
2144
|
-
@driver.action.key_stroke('up')
|
2145
|
-
sleep(1)
|
2146
|
-
@driver.action.key_stroke('enter')
|
2147
|
-
sleep(1)
|
2148
|
-
begin
|
2149
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2150
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2151
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2152
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2153
|
-
rescue
|
2154
|
-
sleep(1)
|
2155
|
-
@driver.action.key_stroke('left')
|
2156
|
-
sleep(1)
|
2157
|
-
@driver.action.key_stroke('up')
|
2158
|
-
sleep(1)
|
2159
|
-
@driver.action.key_stroke('enter')
|
2160
|
-
sleep(1)
|
2161
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2162
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2163
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2164
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2165
|
-
end
|
2166
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2167
|
-
sleep(1)
|
2168
|
-
rescue
|
2169
|
-
begin
|
2170
|
-
@driver.find_element(:xpath, '=//*[@id="code"]').click
|
2171
|
-
|
2172
|
-
sleep(1)
|
2173
|
-
|
2174
|
-
el2 = @driver.find_element(:xpath, '//*[@id="code"]')
|
2175
|
-
@driver.action.context_click(el2).perform
|
2176
|
-
|
2177
|
-
sleep(1)
|
2178
|
-
@driver.action.key_stroke('up')
|
2179
|
-
sleep(1)
|
2180
|
-
@driver.action.key_stroke('up')
|
2181
|
-
sleep(1)
|
2182
|
-
@driver.action.key_stroke('enter')
|
2183
|
-
sleep(1)
|
2184
|
-
begin
|
2185
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2186
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2187
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2188
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2189
|
-
rescue
|
2190
|
-
sleep(1)
|
2191
|
-
@driver.action.key_stroke('left')
|
2192
|
-
sleep(1)
|
2193
|
-
@driver.action.key_stroke('up')
|
2194
|
-
sleep(1)
|
2195
|
-
@driver.action.key_stroke('enter')
|
2196
|
-
sleep(1)
|
2197
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2198
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2199
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2200
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2201
|
-
end
|
2202
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2203
|
-
sleep(1)
|
2204
|
-
rescue
|
2205
|
-
begin
|
2206
|
-
@driver.find_element(:xpath, '//*[@id="kboard-input-captcha"]').click
|
2207
|
-
|
2208
|
-
sleep(1)
|
2209
|
-
|
2210
|
-
el2 = @driver.find_element(:xpath, '//*[@id="kboard-input-captcha"]')
|
2211
|
-
@driver.action.context_click(el2).perform
|
2212
|
-
|
2213
|
-
sleep(1)
|
2214
|
-
@driver.action.key_stroke('up')
|
2215
|
-
sleep(1)
|
2216
|
-
@driver.action.key_stroke('up')
|
2217
|
-
sleep(1)
|
2218
|
-
@driver.action.key_stroke('enter')
|
2219
|
-
sleep(1)
|
2220
|
-
begin
|
2221
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2222
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2223
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2224
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2225
|
-
rescue
|
2226
|
-
sleep(1)
|
2227
|
-
@driver.action.key_stroke('left')
|
2228
|
-
sleep(1)
|
2229
|
-
@driver.action.key_stroke('up')
|
2230
|
-
sleep(1)
|
2231
|
-
@driver.action.key_stroke('enter')
|
2232
|
-
sleep(1)
|
2233
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2234
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2235
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2236
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2237
|
-
end
|
2238
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2239
|
-
sleep(1)
|
2240
|
-
rescue
|
2241
|
-
begin
|
2242
|
-
@driver.find_element(:xpath, '//*[@fw-label="보안문자"]').click
|
2243
|
-
|
2244
|
-
sleep(1)
|
2245
|
-
|
2246
|
-
el2 = @driver.find_element(:xpath, '//*[@fw-label="보안문자"]')
|
2247
|
-
@driver.action.context_click(el2).perform
|
2248
|
-
|
2249
|
-
sleep(1)
|
2250
|
-
@driver.action.key_stroke('up')
|
2251
|
-
sleep(1)
|
2252
|
-
@driver.action.key_stroke('up')
|
2253
|
-
sleep(1)
|
2254
|
-
@driver.action.key_stroke('enter')
|
2255
|
-
sleep(1)
|
2256
|
-
begin
|
2257
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2258
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2259
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2260
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2261
|
-
rescue
|
2262
|
-
sleep(1)
|
2263
|
-
@driver.action.key_stroke('left')
|
2264
|
-
sleep(1)
|
2265
|
-
@driver.action.key_stroke('up')
|
2266
|
-
sleep(1)
|
2267
|
-
@driver.action.key_stroke('enter')
|
2268
|
-
sleep(1)
|
2269
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2270
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2271
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2272
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2273
|
-
end
|
2274
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2275
|
-
sleep(1)
|
2276
|
-
rescue
|
2277
|
-
begin
|
2278
|
-
@driver.find_element(:xpath, '//*[@name="captcha"]').click
|
2279
|
-
sleep(1)
|
2280
|
-
|
2281
|
-
# CAPTCHA 요소 찾기
|
2282
|
-
el2 = @driver.find_element(:xpath, '//*[@name="captcha"]')
|
2283
|
-
|
2284
|
-
# 우클릭 (context_click) 실행
|
2285
|
-
@driver.action.context_click(el2).perform
|
2286
|
-
sleep(1)
|
2287
|
-
@driver.action.key_stroke('up')
|
2288
|
-
sleep(1)
|
2289
|
-
@driver.action.key_stroke('up')
|
2290
|
-
sleep(1)
|
2291
|
-
@driver.action.key_stroke('enter')
|
2292
|
-
begin
|
2293
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2294
|
-
# 요소가 나타날 때까지 7초 동안 기다립니다.
|
2295
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2296
|
-
rescue
|
2297
|
-
sleep(1)
|
2298
|
-
@driver.action.key_stroke('left')
|
2299
|
-
sleep(1)
|
2300
|
-
@driver.action.key_stroke('up')
|
2301
|
-
sleep(1)
|
2302
|
-
@driver.action.key_stroke('enter')
|
2303
|
-
sleep(1)
|
2304
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2305
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2306
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2307
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2308
|
-
end
|
2309
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2310
|
-
sleep(1)
|
2311
|
-
rescue
|
2312
|
-
begin
|
2313
|
-
@driver.find_element(:xpath, '//*[@id="spamCode"]').click
|
2314
|
-
|
2315
|
-
sleep(1)
|
2316
|
-
|
2317
|
-
el2 = @driver.find_element(:xpath, '//*[@id="spamCode"]')
|
2318
|
-
@driver.action.context_click(el2).perform
|
2319
|
-
|
2320
|
-
sleep(1)
|
2321
|
-
@driver.action.key_stroke('up')
|
2322
|
-
sleep(1)
|
2323
|
-
@driver.action.key_stroke('up')
|
2324
|
-
sleep(1)
|
2325
|
-
@driver.action.key_stroke('enter')
|
2326
|
-
sleep(1)
|
2327
|
-
begin
|
2328
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2329
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2330
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2331
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2332
|
-
rescue
|
2333
|
-
sleep(1)
|
2334
|
-
@driver.action.key_stroke('left')
|
2335
|
-
sleep(1)
|
2336
|
-
@driver.action.key_stroke('up')
|
2337
|
-
sleep(1)
|
2338
|
-
@driver.action.key_stroke('enter')
|
2339
|
-
sleep(1)
|
2340
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2341
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2342
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2343
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2344
|
-
end
|
2345
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2346
|
-
sleep(1)
|
2347
|
-
rescue
|
2348
|
-
begin
|
2349
|
-
@driver.find_element(:xpath, '//*[@id="norobot_code"]').click
|
2350
|
-
|
2351
|
-
sleep(1)
|
2352
|
-
|
2353
|
-
el2 = @driver.find_element(:xpath, '//*[@id="norobot_code"]')
|
2354
|
-
@driver.action.context_click(el2).perform
|
2355
|
-
|
2356
|
-
@driver.action.key_stroke('up')
|
2357
|
-
sleep(1)
|
2358
|
-
@driver.action.key_stroke('up')
|
2359
|
-
sleep(1)
|
2360
|
-
@driver.action.key_stroke('enter')
|
2361
|
-
sleep(1)
|
2362
|
-
begin
|
2363
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2364
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2365
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2366
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2367
|
-
rescue
|
2368
|
-
sleep(1)
|
2369
|
-
@driver.action.key_stroke('left')
|
2370
|
-
sleep(1)
|
2371
|
-
@driver.action.key_stroke('up')
|
2372
|
-
sleep(1)
|
2373
|
-
@driver.action.key_stroke('enter')
|
2374
|
-
sleep(1)
|
2375
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2376
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2377
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2378
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2379
|
-
end
|
2380
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2381
|
-
sleep(1)
|
2382
|
-
rescue
|
2383
|
-
begin
|
2384
|
-
@driver.switch_to.default_content()
|
2385
|
-
sleep(1)
|
2386
|
-
@driver.find_element(:xpath, '//*[@name="kcaptcha_code"]').click
|
2387
|
-
|
2388
|
-
sleep(1)
|
2389
|
-
|
2390
|
-
el2 = @driver.find_element(:xpath, '//*[@name="kcaptcha_code"]')
|
2391
|
-
@driver.action.context_click(el2).perform
|
2392
|
-
|
2393
|
-
sleep(1)
|
2394
|
-
@driver.action.key_stroke('up')
|
2395
|
-
sleep(1)
|
2396
|
-
@driver.action.key_stroke('up')
|
2397
|
-
sleep(1)
|
2398
|
-
@driver.action.key_stroke('enter')
|
2399
|
-
sleep(1)
|
2400
|
-
begin
|
2401
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2402
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2403
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2404
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2405
|
-
rescue
|
2406
|
-
sleep(1)
|
2407
|
-
@driver.action.key_stroke('left')
|
2408
|
-
sleep(1)
|
2409
|
-
@driver.action.key_stroke('up')
|
2410
|
-
sleep(1)
|
2411
|
-
@driver.action.key_stroke('enter')
|
2412
|
-
sleep(1)
|
2413
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2414
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2415
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2416
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2417
|
-
end
|
2418
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2419
|
-
sleep(1)
|
2420
|
-
rescue
|
2421
|
-
begin
|
2422
|
-
@driver.switch_to.default_content()
|
2423
|
-
sleep(1)
|
2424
|
-
@driver.find_element(:xpath, '//*[@title="자동글쓰기방지"]').click
|
2425
|
-
|
2426
|
-
sleep(1)
|
2427
|
-
|
2428
|
-
el2 = @driver.find_element(:xpath, '//*[@title="자동글쓰기방지"]')
|
2429
|
-
@driver.action.context_click(el2).perform
|
2430
|
-
|
2431
|
-
sleep(1)
|
2432
|
-
@driver.action.key_stroke('up')
|
2433
|
-
sleep(1)
|
2434
|
-
@driver.action.key_stroke('up')
|
2435
|
-
sleep(1)
|
2436
|
-
@driver.action.key_stroke('enter')
|
2437
|
-
sleep(1)
|
2438
|
-
begin
|
2439
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2440
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2441
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2442
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2443
|
-
rescue
|
2444
|
-
sleep(1)
|
2445
|
-
@driver.action.key_stroke('left')
|
2446
|
-
sleep(1)
|
2447
|
-
@driver.action.key_stroke('up')
|
2448
|
-
sleep(1)
|
2449
|
-
@driver.action.key_stroke('enter')
|
2450
|
-
sleep(1)
|
2451
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2452
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2453
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2454
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2455
|
-
end
|
2456
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2457
|
-
sleep(1)
|
2458
|
-
rescue
|
2459
|
-
begin
|
2460
|
-
@driver.switch_to.default_content()
|
2461
|
-
sleep(1)
|
2462
|
-
@driver.find_element(:xpath, '//*[@id="user_captcha"]').click
|
2463
|
-
|
2464
|
-
sleep(1)
|
2465
|
-
|
2466
|
-
el2 = @driver.find_element(:xpath, '//*[@id="user_captcha"]')
|
2467
|
-
@driver.action.context_click(el2).perform
|
2468
|
-
|
2469
|
-
sleep(1)
|
2470
|
-
@driver.action.key_stroke('up')
|
2471
|
-
sleep(1)
|
2472
|
-
@driver.action.key_stroke('up')
|
2473
|
-
sleep(1)
|
2474
|
-
@driver.action.key_stroke('enter')
|
2475
|
-
sleep(1)
|
2476
|
-
begin
|
2477
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2478
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2479
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2480
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2481
|
-
rescue
|
2482
|
-
sleep(1)
|
2483
|
-
@driver.action.key_stroke('left')
|
2484
|
-
sleep(1)
|
2485
|
-
@driver.action.key_stroke('up')
|
2486
|
-
sleep(1)
|
2487
|
-
@driver.action.key_stroke('enter')
|
2488
|
-
sleep(1)
|
2489
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2490
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2491
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2492
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2493
|
-
end
|
2494
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2495
|
-
sleep(1)
|
2496
|
-
rescue
|
2497
|
-
begin
|
2498
|
-
@driver.switch_to.default_content()
|
2499
|
-
sleep(1)
|
2500
|
-
@driver.find_element(:xpath, '//*[@itemname="자동등록방지"]').click
|
2501
|
-
|
2502
|
-
sleep(1)
|
2503
|
-
|
2504
|
-
el2 = @driver.find_element(:xpath, '//*[@itemname="자동등록방지"]')
|
2505
|
-
@driver.action.context_click(el2).perform
|
2506
|
-
|
2507
|
-
sleep(1)
|
2508
|
-
@driver.action.key_stroke('up')
|
2509
|
-
sleep(1)
|
2510
|
-
@driver.action.key_stroke('up')
|
2511
|
-
sleep(1)
|
2512
|
-
@driver.action.key_stroke('enter')
|
2513
|
-
sleep(1)
|
2514
2166
|
begin
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2167
|
+
@driver.switch_to.default_content()
|
2168
|
+
el = @driver.find_element(:xpath, '//*[@id="zsfImg"]')
|
2169
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2170
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2171
|
+
puts '-[√] 캡챠 코드 code 12.......'.red
|
2520
2172
|
sleep(1)
|
2521
|
-
@driver.
|
2173
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2522
2174
|
sleep(1)
|
2523
|
-
|
2175
|
+
mouse_move_percentage(0.3,0.02)
|
2176
|
+
sleep(0.5)
|
2177
|
+
left_click
|
2524
2178
|
sleep(1)
|
2525
|
-
@driver.
|
2526
|
-
|
2527
|
-
# 요소 찾기 타임아웃을 7초로 설정
|
2528
|
-
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2529
|
-
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2530
|
-
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2531
|
-
end
|
2532
|
-
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2533
|
-
sleep(1)
|
2534
|
-
rescue
|
2535
|
-
begin
|
2536
|
-
@driver.switch_to.default_content()
|
2537
|
-
sleep(1)
|
2538
|
-
@driver.find_element(:xpath, '//*[@name="wr_key"]').click
|
2539
|
-
|
2540
|
-
sleep(1)
|
2541
|
-
|
2542
|
-
el2 = @driver.find_element(:xpath, '//*[@name="wr_key"]')
|
2543
|
-
@driver.action.context_click(el2).perform
|
2544
|
-
|
2545
|
-
sleep(1)
|
2546
|
-
@driver.action.key_stroke('up')
|
2547
|
-
sleep(1)
|
2548
|
-
@driver.action.key_stroke('up')
|
2179
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2180
|
+
@driver.action.context_click(el).perform #우 클릭
|
2549
2181
|
sleep(1)
|
2550
|
-
@driver.action.key_stroke('
|
2182
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2551
2183
|
sleep(1)
|
2184
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2185
|
+
rescue
|
2552
2186
|
begin
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2187
|
+
@driver.switch_to.default_content()
|
2188
|
+
el = @driver.find_element(:xpath, '//*[@id="spamauth"]')
|
2189
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2190
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2191
|
+
puts '-[√] 캡챠 코드 code 13.......'.red
|
2558
2192
|
sleep(1)
|
2559
|
-
@driver.
|
2193
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2560
2194
|
sleep(1)
|
2561
|
-
|
2195
|
+
mouse_move_percentage(0.3,0.02)
|
2196
|
+
sleep(0.5)
|
2197
|
+
left_click
|
2562
2198
|
sleep(1)
|
2563
|
-
@driver.
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2199
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2200
|
+
@driver.action.context_click(el).perform #우 클릭
|
2201
|
+
sleep(1)
|
2202
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2203
|
+
sleep(1)
|
2204
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2205
|
+
rescue
|
2206
|
+
begin
|
2207
|
+
@driver.switch_to.default_content()
|
2208
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "autoStrParam")]')
|
2209
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2210
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2211
|
+
puts '-[√] 캡챠 코드 code 14.......'.red
|
2212
|
+
sleep(1)
|
2213
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2214
|
+
sleep(1)
|
2215
|
+
mouse_move_percentage(0.3,0.02)
|
2216
|
+
sleep(0.5)
|
2217
|
+
left_click
|
2218
|
+
sleep(1)
|
2219
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2220
|
+
@driver.action.context_click(el).perform #우 클릭
|
2221
|
+
sleep(1)
|
2222
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2223
|
+
sleep(1)
|
2224
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2225
|
+
rescue
|
2226
|
+
begin
|
2227
|
+
@driver.switch_to.default_content()
|
2228
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "norobot_image")]')
|
2229
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2230
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2231
|
+
puts '-[√] 캡챠 코드 code 15.......'.red
|
2232
|
+
sleep(1)
|
2233
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2234
|
+
sleep(1)
|
2235
|
+
mouse_move_percentage(0.3,0.02)
|
2236
|
+
sleep(0.5)
|
2237
|
+
left_click
|
2238
|
+
sleep(1)
|
2239
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2240
|
+
@driver.action.context_click(el).perform #우 클릭
|
2241
|
+
sleep(1)
|
2242
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2243
|
+
sleep(1)
|
2244
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2245
|
+
rescue
|
2246
|
+
|
2247
|
+
begin
|
2248
|
+
@driver.switch_to.default_content()
|
2249
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "code_graph")]')
|
2250
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2251
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2252
|
+
puts '-[√] 캡챠 코드 code 16.......'.red
|
2253
|
+
sleep(1)
|
2254
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2255
|
+
sleep(1)
|
2256
|
+
mouse_move_percentage(0.3,0.02)
|
2257
|
+
sleep(0.5)
|
2258
|
+
left_click
|
2259
|
+
sleep(1)
|
2260
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2261
|
+
@driver.action.context_click(el).perform #우 클릭
|
2262
|
+
sleep(1)
|
2263
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2264
|
+
sleep(1)
|
2265
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2266
|
+
rescue
|
2267
|
+
|
2268
|
+
begin
|
2269
|
+
@driver.switch_to.default_content()
|
2270
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "/captcha/images/image.php")]')
|
2271
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2272
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2273
|
+
puts '-[√] 캡챠 코드 code 17.......'.red
|
2274
|
+
sleep(1)
|
2275
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2276
|
+
sleep(1)
|
2277
|
+
mouse_move_percentage(0.3,0.02)
|
2278
|
+
sleep(0.5)
|
2279
|
+
left_click
|
2280
|
+
sleep(1)
|
2281
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2282
|
+
@driver.action.context_click(el).perform #우 클릭
|
2283
|
+
sleep(1)
|
2284
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2285
|
+
sleep(1)
|
2286
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2287
|
+
rescue
|
2288
|
+
|
2289
|
+
begin
|
2290
|
+
@driver.switch_to.default_content()
|
2291
|
+
el = @driver.find_element(:xpath, '//img[@id="protect_img"]')
|
2292
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2293
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2294
|
+
puts '-[√] 캡챠 코드 code 18.......'.red
|
2295
|
+
sleep(1)
|
2296
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2297
|
+
sleep(1)
|
2298
|
+
mouse_move_percentage(0.3,0.02)
|
2299
|
+
sleep(0.5)
|
2300
|
+
left_click
|
2301
|
+
sleep(1)
|
2302
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2303
|
+
@driver.action.context_click(el).perform #우 클릭
|
2304
|
+
sleep(1)
|
2305
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2306
|
+
sleep(1)
|
2307
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2308
|
+
rescue
|
2309
|
+
begin
|
2310
|
+
@driver.switch_to.default_content()
|
2311
|
+
el = @driver.find_element(:xpath, '//img[contains(@src, "/captcha/")]')
|
2312
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2313
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2314
|
+
puts '-[√] 캡챠 코드 code 19.......'.red
|
2315
|
+
sleep(1)
|
2316
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2317
|
+
sleep(1)
|
2318
|
+
mouse_move_percentage(0.3,0.02)
|
2319
|
+
sleep(0.5)
|
2320
|
+
left_click
|
2321
|
+
sleep(1)
|
2322
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2323
|
+
@driver.action.context_click(el).perform #우 클릭
|
2324
|
+
sleep(1)
|
2325
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2326
|
+
sleep(1)
|
2327
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2328
|
+
rescue
|
2329
|
+
begin
|
2330
|
+
@driver.switch_to.default_content()
|
2331
|
+
el = @driver.find_element(:xpath, '//*[@alt="captcha"]')
|
2332
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
2333
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
2334
|
+
puts '-[√] 캡챠 코드 code 20.......'.red
|
2335
|
+
sleep(1)
|
2336
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
2337
|
+
sleep(1)
|
2338
|
+
mouse_move_percentage(0.3,0.02)
|
2339
|
+
sleep(0.5)
|
2340
|
+
left_click
|
2341
|
+
sleep(1)
|
2342
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
2343
|
+
@driver.action.context_click(el).perform #우 클릭
|
2344
|
+
sleep(1)
|
2345
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
2346
|
+
sleep(1)
|
2347
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
2348
|
+
rescue
|
2349
|
+
|
2350
|
+
end
|
2351
|
+
|
2352
|
+
end
|
2353
|
+
|
2354
|
+
end
|
2355
|
+
|
2356
|
+
end
|
2357
|
+
end
|
2358
|
+
end
|
2359
|
+
|
2569
2360
|
end
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2361
|
+
|
2362
|
+
end
|
2363
|
+
|
2364
|
+
end
|
2365
|
+
end
|
2366
|
+
end
|
2367
|
+
end
|
2368
|
+
end
|
2369
|
+
end
|
2370
|
+
end
|
2371
|
+
end
|
2372
|
+
end
|
2373
|
+
end
|
2374
|
+
end
|
2375
|
+
end
|
2376
|
+
end
|
2377
|
+
|
2378
|
+
sleep(1)
|
2379
|
+
begin
|
2380
|
+
@driver.switch_to.default_content()
|
2381
|
+
rescue
|
2382
|
+
end
|
2383
|
+
|
2384
|
+
puts '-[√] 캡챠 입력 항목 탐색.......'.green
|
2385
|
+
begin
|
2386
|
+
@driver.find_element(:xpath, '//*[@name="captcha_key"]').click
|
2387
|
+
|
2388
|
+
sleep(1)
|
2389
|
+
|
2390
|
+
el2 = @driver.find_element(:xpath, '//*[@name="captcha_key"]')
|
2391
|
+
@driver.action.context_click(el2).perform
|
2392
|
+
sleep(1)
|
2393
|
+
@driver.action.key_stroke('up')
|
2394
|
+
sleep(1)
|
2395
|
+
@driver.action.key_stroke('up')
|
2396
|
+
sleep(1)
|
2397
|
+
@driver.action.key_stroke('enter')
|
2398
|
+
sleep(1)
|
2399
|
+
|
2400
|
+
begin
|
2401
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2402
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2403
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2404
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2405
|
+
rescue
|
2406
|
+
sleep(1)
|
2407
|
+
@driver.action.key_stroke('left')
|
2408
|
+
sleep(1)
|
2409
|
+
@driver.action.key_stroke('up')
|
2410
|
+
sleep(1)
|
2411
|
+
@driver.action.key_stroke('enter')
|
2412
|
+
sleep(1)
|
2413
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2414
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2415
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2416
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2417
|
+
end
|
2418
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2419
|
+
|
2420
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2421
|
+
sleep(2)
|
2422
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2423
|
+
sleep(2)
|
2424
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2425
|
+
sleep(1)
|
2426
|
+
rescue
|
2427
|
+
begin
|
2428
|
+
@driver.find_element(:xpath, '//*[@id="captcha_key"]').click
|
2429
|
+
|
2430
|
+
sleep(1)
|
2431
|
+
|
2432
|
+
el2 = @driver.find_element(:xpath, '//*[@id="captcha_key"]')
|
2433
|
+
@driver.action.context_click(el2).perform
|
2434
|
+
|
2435
|
+
sleep(1)
|
2436
|
+
@driver.action.key_stroke('up')
|
2437
|
+
sleep(1)
|
2438
|
+
@driver.action.key_stroke('up')
|
2439
|
+
sleep(1)
|
2440
|
+
@driver.action.key_stroke('enter')
|
2441
|
+
sleep(1)
|
2442
|
+
begin
|
2443
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2444
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2445
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2446
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2447
|
+
rescue
|
2448
|
+
sleep(1)
|
2449
|
+
@driver.action.key_stroke('left')
|
2450
|
+
sleep(1)
|
2451
|
+
@driver.action.key_stroke('up')
|
2452
|
+
sleep(1)
|
2453
|
+
@driver.action.key_stroke('enter')
|
2454
|
+
sleep(1)
|
2455
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2456
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2457
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2458
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2459
|
+
end
|
2460
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2461
|
+
|
2462
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2463
|
+
sleep(2)
|
2464
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2465
|
+
sleep(2)
|
2466
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2467
|
+
sleep(1)
|
2468
|
+
rescue
|
2469
|
+
begin
|
2470
|
+
@driver.find_element(:xpath, '=//*[@id="code"]').click
|
2471
|
+
|
2472
|
+
sleep(1)
|
2473
|
+
|
2474
|
+
el2 = @driver.find_element(:xpath, '//*[@id="code"]')
|
2475
|
+
@driver.action.context_click(el2).perform
|
2476
|
+
|
2477
|
+
sleep(1)
|
2478
|
+
@driver.action.key_stroke('up')
|
2479
|
+
sleep(1)
|
2480
|
+
@driver.action.key_stroke('up')
|
2481
|
+
sleep(1)
|
2482
|
+
@driver.action.key_stroke('enter')
|
2483
|
+
sleep(1)
|
2484
|
+
begin
|
2485
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2486
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2487
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2488
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2489
|
+
rescue
|
2490
|
+
sleep(1)
|
2491
|
+
@driver.action.key_stroke('left')
|
2492
|
+
sleep(1)
|
2493
|
+
@driver.action.key_stroke('up')
|
2494
|
+
sleep(1)
|
2495
|
+
@driver.action.key_stroke('enter')
|
2496
|
+
sleep(1)
|
2497
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2498
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2499
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2500
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2501
|
+
end
|
2502
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2503
|
+
|
2504
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2505
|
+
sleep(2)
|
2506
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2507
|
+
sleep(2)
|
2508
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2509
|
+
sleep(1)
|
2510
|
+
rescue
|
2511
|
+
begin
|
2512
|
+
@driver.find_element(:xpath, '//*[@id="kboard-input-captcha"]').click
|
2513
|
+
|
2514
|
+
sleep(1)
|
2515
|
+
|
2516
|
+
el2 = @driver.find_element(:xpath, '//*[@id="kboard-input-captcha"]')
|
2517
|
+
@driver.action.context_click(el2).perform
|
2518
|
+
|
2519
|
+
sleep(1)
|
2520
|
+
@driver.action.key_stroke('up')
|
2521
|
+
sleep(1)
|
2522
|
+
@driver.action.key_stroke('up')
|
2523
|
+
sleep(1)
|
2524
|
+
@driver.action.key_stroke('enter')
|
2525
|
+
sleep(1)
|
2526
|
+
begin
|
2527
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2528
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2529
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2530
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2531
|
+
rescue
|
2532
|
+
sleep(1)
|
2533
|
+
@driver.action.key_stroke('left')
|
2534
|
+
sleep(1)
|
2535
|
+
@driver.action.key_stroke('up')
|
2536
|
+
sleep(1)
|
2537
|
+
@driver.action.key_stroke('enter')
|
2538
|
+
sleep(1)
|
2539
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2540
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2541
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2542
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2543
|
+
end
|
2544
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2545
|
+
|
2546
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2547
|
+
sleep(2)
|
2548
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2549
|
+
sleep(2)
|
2550
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2551
|
+
sleep(1)
|
2552
|
+
rescue
|
2553
|
+
begin
|
2554
|
+
@driver.find_element(:xpath, '//*[@fw-label="보안문자"]').click
|
2555
|
+
|
2556
|
+
sleep(1)
|
2557
|
+
|
2558
|
+
el2 = @driver.find_element(:xpath, '//*[@fw-label="보안문자"]')
|
2559
|
+
@driver.action.context_click(el2).perform
|
2560
|
+
|
2561
|
+
sleep(1)
|
2562
|
+
@driver.action.key_stroke('up')
|
2563
|
+
sleep(1)
|
2564
|
+
@driver.action.key_stroke('up')
|
2565
|
+
sleep(1)
|
2566
|
+
@driver.action.key_stroke('enter')
|
2567
|
+
sleep(1)
|
2568
|
+
begin
|
2569
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2570
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2571
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2572
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2573
|
+
rescue
|
2574
|
+
sleep(1)
|
2575
|
+
@driver.action.key_stroke('left')
|
2576
|
+
sleep(1)
|
2577
|
+
@driver.action.key_stroke('up')
|
2578
|
+
sleep(1)
|
2579
|
+
@driver.action.key_stroke('enter')
|
2580
|
+
sleep(1)
|
2581
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2582
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2583
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2584
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2585
|
+
end
|
2586
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2587
|
+
|
2588
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2589
|
+
sleep(2)
|
2590
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2591
|
+
sleep(2)
|
2592
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2593
|
+
sleep(1)
|
2594
|
+
rescue
|
2595
|
+
begin
|
2596
|
+
@driver.find_element(:xpath, '//*[@name="captcha"]').click
|
2597
|
+
sleep(1)
|
2598
|
+
|
2599
|
+
# CAPTCHA 요소 찾기
|
2600
|
+
el2 = @driver.find_element(:xpath, '//*[@name="captcha"]')
|
2601
|
+
|
2602
|
+
# 우클릭 (context_click) 실행
|
2603
|
+
@driver.action.context_click(el2).perform
|
2604
|
+
sleep(1)
|
2605
|
+
@driver.action.key_stroke('up')
|
2606
|
+
sleep(1)
|
2607
|
+
@driver.action.key_stroke('up')
|
2608
|
+
sleep(1)
|
2609
|
+
@driver.action.key_stroke('enter')
|
2610
|
+
begin
|
2611
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2612
|
+
# 요소가 나타날 때까지 7초 동안 기다립니다.
|
2613
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2614
|
+
rescue
|
2615
|
+
sleep(1)
|
2616
|
+
@driver.action.key_stroke('left')
|
2617
|
+
sleep(1)
|
2618
|
+
@driver.action.key_stroke('up')
|
2619
|
+
sleep(1)
|
2620
|
+
@driver.action.key_stroke('enter')
|
2621
|
+
sleep(1)
|
2622
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2623
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2624
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2625
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2626
|
+
end
|
2627
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2628
|
+
|
2629
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2630
|
+
sleep(2)
|
2631
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2632
|
+
sleep(2)
|
2633
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2634
|
+
sleep(1)
|
2635
|
+
rescue
|
2636
|
+
begin
|
2637
|
+
@driver.find_element(:xpath, '//*[@id="spamCode"]').click
|
2638
|
+
sleep(1)
|
2639
|
+
|
2640
|
+
el2 = @driver.find_element(:xpath, '//*[@id="spamCode"]')
|
2641
|
+
@driver.action.context_click(el2).perform
|
2642
|
+
|
2643
|
+
sleep(1)
|
2644
|
+
@driver.action.key_stroke('up')
|
2645
|
+
sleep(1)
|
2646
|
+
@driver.action.key_stroke('up')
|
2647
|
+
sleep(1)
|
2648
|
+
@driver.action.key_stroke('enter')
|
2649
|
+
sleep(1)
|
2650
|
+
begin
|
2651
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2652
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2653
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2654
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2655
|
+
rescue
|
2656
|
+
sleep(1)
|
2657
|
+
@driver.action.key_stroke('left')
|
2658
|
+
sleep(1)
|
2659
|
+
@driver.action.key_stroke('up')
|
2660
|
+
sleep(1)
|
2661
|
+
@driver.action.key_stroke('enter')
|
2662
|
+
sleep(1)
|
2663
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2664
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2665
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2666
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2667
|
+
end
|
2668
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2669
|
+
|
2670
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2671
|
+
sleep(2)
|
2672
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2673
|
+
sleep(2)
|
2674
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2675
|
+
sleep(1)
|
2676
|
+
rescue
|
2677
|
+
begin
|
2678
|
+
@driver.find_element(:xpath, '//*[@id="norobot_code"]').click
|
2679
|
+
|
2680
|
+
sleep(1)
|
2681
|
+
|
2682
|
+
el2 = @driver.find_element(:xpath, '//*[@id="norobot_code"]')
|
2683
|
+
@driver.action.context_click(el2).perform
|
2684
|
+
|
2685
|
+
@driver.action.key_stroke('up')
|
2686
|
+
sleep(1)
|
2687
|
+
@driver.action.key_stroke('up')
|
2688
|
+
sleep(1)
|
2689
|
+
@driver.action.key_stroke('enter')
|
2690
|
+
sleep(1)
|
2691
|
+
begin
|
2692
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2693
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2694
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2695
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2696
|
+
rescue
|
2697
|
+
sleep(1)
|
2698
|
+
@driver.action.key_stroke('left')
|
2699
|
+
sleep(1)
|
2700
|
+
@driver.action.key_stroke('up')
|
2701
|
+
sleep(1)
|
2702
|
+
@driver.action.key_stroke('enter')
|
2703
|
+
sleep(1)
|
2704
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2705
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2706
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2707
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2708
|
+
end
|
2709
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2710
|
+
|
2711
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2712
|
+
sleep(2)
|
2713
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2714
|
+
sleep(2)
|
2715
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2716
|
+
sleep(1)
|
2717
|
+
rescue
|
2718
|
+
begin
|
2719
|
+
|
2720
|
+
@driver.find_element(:xpath, '//*[@name="kcaptcha_code"]').click
|
2721
|
+
|
2722
|
+
sleep(1)
|
2723
|
+
|
2724
|
+
el2 = @driver.find_element(:xpath, '//*[@name="kcaptcha_code"]')
|
2725
|
+
@driver.action.context_click(el2).perform
|
2726
|
+
|
2727
|
+
sleep(1)
|
2728
|
+
@driver.action.key_stroke('up')
|
2729
|
+
sleep(1)
|
2730
|
+
@driver.action.key_stroke('up')
|
2731
|
+
sleep(1)
|
2732
|
+
@driver.action.key_stroke('enter')
|
2733
|
+
sleep(1)
|
2734
|
+
begin
|
2735
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2736
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2737
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2738
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2739
|
+
rescue
|
2740
|
+
sleep(1)
|
2741
|
+
@driver.action.key_stroke('left')
|
2742
|
+
sleep(1)
|
2743
|
+
@driver.action.key_stroke('up')
|
2744
|
+
sleep(1)
|
2745
|
+
@driver.action.key_stroke('enter')
|
2746
|
+
sleep(1)
|
2747
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2748
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2749
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2750
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2751
|
+
end
|
2752
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2753
|
+
|
2754
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2755
|
+
sleep(2)
|
2756
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2757
|
+
sleep(2)
|
2758
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2759
|
+
sleep(1)
|
2760
|
+
rescue
|
2761
|
+
begin
|
2762
|
+
|
2763
|
+
@driver.find_element(:xpath, '//*[@title="자동글쓰기방지"]').click
|
2764
|
+
|
2765
|
+
sleep(1)
|
2766
|
+
|
2767
|
+
el2 = @driver.find_element(:xpath, '//*[@title="자동글쓰기방지"]')
|
2768
|
+
@driver.action.context_click(el2).perform
|
2769
|
+
|
2770
|
+
sleep(1)
|
2771
|
+
@driver.action.key_stroke('up')
|
2772
|
+
sleep(1)
|
2773
|
+
@driver.action.key_stroke('up')
|
2774
|
+
sleep(1)
|
2775
|
+
@driver.action.key_stroke('enter')
|
2776
|
+
sleep(1)
|
2777
|
+
begin
|
2778
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2779
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2780
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2781
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2782
|
+
rescue
|
2783
|
+
sleep(1)
|
2784
|
+
@driver.action.key_stroke('left')
|
2785
|
+
sleep(1)
|
2786
|
+
@driver.action.key_stroke('up')
|
2787
|
+
sleep(1)
|
2788
|
+
@driver.action.key_stroke('enter')
|
2789
|
+
sleep(1)
|
2790
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2791
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2792
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2793
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2794
|
+
end
|
2795
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2796
|
+
|
2797
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2798
|
+
sleep(2)
|
2799
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2800
|
+
sleep(2)
|
2801
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2802
|
+
sleep(1)
|
2803
|
+
rescue
|
2804
|
+
begin
|
2805
|
+
|
2806
|
+
@driver.find_element(:xpath, '//*[@id="user_captcha"]').click
|
2807
|
+
|
2808
|
+
sleep(1)
|
2809
|
+
|
2810
|
+
el2 = @driver.find_element(:xpath, '//*[@id="user_captcha"]')
|
2811
|
+
@driver.action.context_click(el2).perform
|
2812
|
+
|
2813
|
+
sleep(1)
|
2814
|
+
@driver.action.key_stroke('up')
|
2815
|
+
sleep(1)
|
2816
|
+
@driver.action.key_stroke('up')
|
2817
|
+
sleep(1)
|
2818
|
+
@driver.action.key_stroke('enter')
|
2819
|
+
sleep(1)
|
2820
|
+
begin
|
2821
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2822
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2823
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2824
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2825
|
+
rescue
|
2826
|
+
sleep(1)
|
2827
|
+
@driver.action.key_stroke('left')
|
2828
|
+
sleep(1)
|
2829
|
+
@driver.action.key_stroke('up')
|
2830
|
+
sleep(1)
|
2831
|
+
@driver.action.key_stroke('enter')
|
2832
|
+
sleep(1)
|
2833
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2834
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2835
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2836
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2837
|
+
end
|
2838
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2839
|
+
|
2840
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2841
|
+
sleep(2)
|
2842
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2843
|
+
sleep(2)
|
2844
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2845
|
+
sleep(1)
|
2846
|
+
rescue
|
2847
|
+
begin
|
2848
|
+
|
2849
|
+
@driver.find_element(:xpath, '//*[@itemname="자동등록방지"]').click
|
2850
|
+
|
2851
|
+
sleep(1)
|
2852
|
+
|
2853
|
+
el2 = @driver.find_element(:xpath, '//*[@itemname="자동등록방지"]')
|
2854
|
+
@driver.action.context_click(el2).perform
|
2855
|
+
|
2856
|
+
sleep(1)
|
2857
|
+
@driver.action.key_stroke('up')
|
2858
|
+
sleep(1)
|
2859
|
+
@driver.action.key_stroke('up')
|
2860
|
+
sleep(1)
|
2861
|
+
@driver.action.key_stroke('enter')
|
2862
|
+
sleep(1)
|
2863
|
+
begin
|
2864
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2865
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2866
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2867
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2868
|
+
rescue
|
2869
|
+
sleep(1)
|
2870
|
+
@driver.action.key_stroke('left')
|
2871
|
+
sleep(1)
|
2872
|
+
@driver.action.key_stroke('up')
|
2873
|
+
sleep(1)
|
2874
|
+
@driver.action.key_stroke('enter')
|
2875
|
+
sleep(1)
|
2876
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2877
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2878
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2879
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2880
|
+
end
|
2881
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2882
|
+
|
2883
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2884
|
+
sleep(2)
|
2885
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2886
|
+
sleep(2)
|
2887
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2888
|
+
sleep(1)
|
2889
|
+
rescue
|
2890
|
+
begin
|
2891
|
+
|
2892
|
+
@driver.find_element(:xpath, '//*[@name="wr_key"]').click
|
2893
|
+
|
2894
|
+
sleep(1)
|
2895
|
+
|
2896
|
+
el2 = @driver.find_element(:xpath, '//*[@name="wr_key"]')
|
2897
|
+
@driver.action.context_click(el2).perform
|
2898
|
+
|
2899
|
+
sleep(1)
|
2900
|
+
@driver.action.key_stroke('up')
|
2901
|
+
sleep(1)
|
2902
|
+
@driver.action.key_stroke('up')
|
2903
|
+
sleep(1)
|
2904
|
+
@driver.action.key_stroke('enter')
|
2905
|
+
sleep(1)
|
2906
|
+
begin
|
2907
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2908
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2909
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2910
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2911
|
+
rescue
|
2912
|
+
sleep(1)
|
2913
|
+
@driver.action.key_stroke('left')
|
2914
|
+
sleep(1)
|
2915
|
+
@driver.action.key_stroke('up')
|
2916
|
+
sleep(1)
|
2917
|
+
@driver.action.key_stroke('enter')
|
2918
|
+
sleep(1)
|
2919
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2920
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2921
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2922
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2923
|
+
end
|
2924
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2925
|
+
|
2926
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2927
|
+
sleep(2)
|
2928
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2929
|
+
sleep(2)
|
2930
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2931
|
+
sleep(1)
|
2932
|
+
rescue
|
2933
|
+
begin
|
2934
|
+
|
2935
|
+
@driver.find_element(:xpath, '//*[@title="자동등록방지"]').click
|
2936
|
+
|
2937
|
+
sleep(1)
|
2938
|
+
|
2939
|
+
el2 = @driver.find_element(:xpath, '//*[@title="자동등록방지"]')
|
2940
|
+
@driver.action.context_click(el2).perform
|
2941
|
+
|
2942
|
+
sleep(1)
|
2943
|
+
@driver.action.key_stroke('up')
|
2944
|
+
sleep(1)
|
2945
|
+
@driver.action.key_stroke('up')
|
2946
|
+
sleep(1)
|
2947
|
+
@driver.action.key_stroke('enter')
|
2948
|
+
sleep(1)
|
2949
|
+
begin
|
2950
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2951
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2952
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2953
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2954
|
+
rescue
|
2955
|
+
sleep(1)
|
2956
|
+
@driver.action.key_stroke('left')
|
2957
|
+
sleep(1)
|
2958
|
+
@driver.action.key_stroke('up')
|
2959
|
+
sleep(1)
|
2960
|
+
@driver.action.key_stroke('enter')
|
2961
|
+
sleep(1)
|
2962
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2963
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2964
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2965
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2966
|
+
end
|
2967
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
2968
|
+
|
2969
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2970
|
+
sleep(2)
|
2971
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2972
|
+
sleep(2)
|
2973
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2974
|
+
sleep(1)
|
2975
|
+
rescue
|
2976
|
+
begin
|
2977
|
+
|
2978
|
+
@driver.find_element(:xpath, '//input[@name="kcaptcha_img"]').click
|
2979
|
+
|
2980
|
+
sleep(1)
|
2981
|
+
|
2982
|
+
el2 = @driver.find_element(:xpath, '//input[@name="kcaptcha_img"]')
|
2983
|
+
@driver.action.context_click(el2).perform
|
2984
|
+
|
2985
|
+
sleep(1)
|
2986
|
+
@driver.action.key_stroke('up')
|
2987
|
+
sleep(1)
|
2988
|
+
@driver.action.key_stroke('up')
|
2989
|
+
sleep(1)
|
2990
|
+
@driver.action.key_stroke('enter')
|
2991
|
+
sleep(1)
|
2992
|
+
begin
|
2993
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
2994
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
2995
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
2996
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
2997
|
+
rescue
|
2998
|
+
sleep(1)
|
2999
|
+
@driver.action.key_stroke('left')
|
3000
|
+
sleep(1)
|
3001
|
+
@driver.action.key_stroke('up')
|
3002
|
+
sleep(1)
|
3003
|
+
@driver.action.key_stroke('enter')
|
3004
|
+
sleep(1)
|
3005
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3006
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3007
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3008
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3009
|
+
end
|
3010
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3011
|
+
|
3012
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3013
|
+
sleep(2)
|
3014
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3015
|
+
sleep(2)
|
3016
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3017
|
+
sleep(1)
|
3018
|
+
rescue
|
3019
|
+
begin
|
3020
|
+
|
3021
|
+
@driver.find_element(:xpath, '//*[@id="zsfCode"]').click
|
3022
|
+
|
3023
|
+
sleep(1)
|
3024
|
+
|
3025
|
+
el2 = @driver.find_element(:xpath, '//*[@id="zsfCode"]')
|
3026
|
+
@driver.action.context_click(el2).perform
|
3027
|
+
|
3028
|
+
sleep(1)
|
3029
|
+
@driver.action.key_stroke('up')
|
3030
|
+
sleep(1)
|
3031
|
+
@driver.action.key_stroke('up')
|
3032
|
+
sleep(1)
|
3033
|
+
@driver.action.key_stroke('enter')
|
3034
|
+
sleep(1)
|
3035
|
+
begin
|
3036
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3037
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3038
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3039
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3040
|
+
rescue
|
3041
|
+
sleep(1)
|
3042
|
+
@driver.action.key_stroke('left')
|
3043
|
+
sleep(1)
|
3044
|
+
@driver.action.key_stroke('up')
|
3045
|
+
sleep(1)
|
3046
|
+
@driver.action.key_stroke('enter')
|
3047
|
+
sleep(1)
|
3048
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3049
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3050
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3051
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3052
|
+
end
|
3053
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3054
|
+
|
3055
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3056
|
+
sleep(2)
|
3057
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3058
|
+
sleep(2)
|
3059
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3060
|
+
sleep(1)
|
3061
|
+
rescue
|
3062
|
+
begin
|
3063
|
+
|
3064
|
+
@driver.find_element(:xpath, '//*[@name="spamCode"]').click
|
3065
|
+
sleep(1)
|
3066
|
+
|
3067
|
+
el2 = @driver.find_element(:xpath, '//*[@name="spamCode"]')
|
3068
|
+
@driver.action.context_click(el2).perform
|
3069
|
+
|
3070
|
+
sleep(1)
|
3071
|
+
@driver.action.key_stroke('up')
|
3072
|
+
sleep(1)
|
3073
|
+
@driver.action.key_stroke('up')
|
3074
|
+
sleep(1)
|
3075
|
+
@driver.action.key_stroke('enter')
|
3076
|
+
sleep(1)
|
3077
|
+
begin
|
3078
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3079
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3080
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3081
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3082
|
+
rescue
|
3083
|
+
sleep(1)
|
3084
|
+
@driver.action.key_stroke('left')
|
3085
|
+
sleep(1)
|
3086
|
+
@driver.action.key_stroke('up')
|
3087
|
+
sleep(1)
|
3088
|
+
@driver.action.key_stroke('enter')
|
3089
|
+
sleep(1)
|
3090
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3091
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3092
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3093
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3094
|
+
end
|
3095
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3096
|
+
|
3097
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3098
|
+
sleep(2)
|
3099
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3100
|
+
sleep(2)
|
3101
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3102
|
+
sleep(1)
|
3103
|
+
rescue
|
3104
|
+
begin
|
3105
|
+
|
3106
|
+
@driver.find_element(:xpath, '//*[@for="spamCode"]').click
|
3107
|
+
sleep(1)
|
3108
|
+
|
3109
|
+
el2 = @driver.find_element(:xpath, '//*[@name="spamCode"]')
|
3110
|
+
@driver.action.context_click(el2).perform
|
3111
|
+
|
3112
|
+
sleep(1)
|
3113
|
+
@driver.action.key_stroke('up')
|
3114
|
+
sleep(1)
|
3115
|
+
@driver.action.key_stroke('up')
|
3116
|
+
sleep(1)
|
3117
|
+
@driver.action.key_stroke('enter')
|
3118
|
+
sleep(1)
|
3119
|
+
begin
|
3120
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3121
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3122
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3123
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3124
|
+
rescue
|
3125
|
+
sleep(1)
|
3126
|
+
@driver.action.key_stroke('left')
|
3127
|
+
sleep(1)
|
3128
|
+
@driver.action.key_stroke('up')
|
3129
|
+
sleep(1)
|
3130
|
+
@driver.action.key_stroke('enter')
|
3131
|
+
sleep(1)
|
3132
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3133
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3134
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3135
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3136
|
+
end
|
3137
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3138
|
+
|
3139
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3140
|
+
sleep(2)
|
3141
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3142
|
+
sleep(2)
|
3143
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3144
|
+
sleep(1)
|
3145
|
+
rescue
|
3146
|
+
begin
|
3147
|
+
|
3148
|
+
@driver.find_element(:xpath, '//*[@name="autoWriteProtect"]').click
|
3149
|
+
sleep(1)
|
3150
|
+
|
3151
|
+
el2 = @driver.find_element(:xpath, '//*[@name="autoWriteProtect"]')
|
3152
|
+
@driver.action.context_click(el2).perform
|
3153
|
+
|
3154
|
+
sleep(1)
|
3155
|
+
@driver.action.key_stroke('up')
|
3156
|
+
sleep(1)
|
3157
|
+
@driver.action.key_stroke('up')
|
3158
|
+
sleep(1)
|
3159
|
+
@driver.action.key_stroke('enter')
|
3160
|
+
sleep(1)
|
3161
|
+
begin
|
3162
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3163
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3164
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3165
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3166
|
+
rescue
|
3167
|
+
sleep(1)
|
3168
|
+
@driver.action.key_stroke('left')
|
3169
|
+
sleep(1)
|
3170
|
+
@driver.action.key_stroke('up')
|
3171
|
+
sleep(1)
|
3172
|
+
@driver.action.key_stroke('enter')
|
3173
|
+
sleep(1)
|
3174
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3175
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3176
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3177
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3178
|
+
end
|
3179
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3180
|
+
|
3181
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3182
|
+
sleep(2)
|
3183
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3184
|
+
sleep(2)
|
3185
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3186
|
+
sleep(1)
|
3187
|
+
rescue
|
3188
|
+
begin
|
3189
|
+
|
3190
|
+
@driver.find_element(:xpath, '//input[@name="vcode" and @id="vcode"]').click
|
3191
|
+
sleep(1)
|
3192
|
+
el2 = @driver.find_element(:xpath, '//input[@name="vcode" and @id="vcode"]')
|
3193
|
+
@driver.action.context_click(el2).perform
|
3194
|
+
|
3195
|
+
sleep(1)
|
3196
|
+
@driver.action.key_stroke('up')
|
3197
|
+
sleep(1)
|
3198
|
+
@driver.action.key_stroke('up')
|
3199
|
+
sleep(1)
|
3200
|
+
@driver.action.key_stroke('enter')
|
3201
|
+
sleep(1)
|
3202
|
+
begin
|
3203
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3204
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3205
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3206
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3207
|
+
rescue
|
3208
|
+
sleep(1)
|
3209
|
+
@driver.action.key_stroke('left')
|
3210
|
+
sleep(1)
|
3211
|
+
@driver.action.key_stroke('up')
|
3212
|
+
sleep(1)
|
3213
|
+
@driver.action.key_stroke('enter')
|
3214
|
+
sleep(1)
|
3215
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3216
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3217
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3218
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3219
|
+
end
|
3220
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3221
|
+
|
3222
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3223
|
+
sleep(2)
|
3224
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3225
|
+
sleep(2)
|
3226
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3227
|
+
sleep(1)
|
3228
|
+
rescue
|
3229
|
+
begin
|
3230
|
+
|
3231
|
+
@driver.find_element(:xpath, '//*[@name="ltm_code"]').click
|
3232
|
+
sleep(1)
|
3233
|
+
el2 = @driver.find_element(:xpath, '//*[@name="ltm_code"]')
|
3234
|
+
@driver.action.context_click(el2).perform
|
2573
3235
|
|
3236
|
+
sleep(1)
|
3237
|
+
@driver.action.key_stroke('up')
|
3238
|
+
sleep(1)
|
3239
|
+
@driver.action.key_stroke('up')
|
3240
|
+
sleep(1)
|
3241
|
+
@driver.action.key_stroke('enter')
|
3242
|
+
sleep(1)
|
3243
|
+
begin
|
3244
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3245
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3246
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3247
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3248
|
+
rescue
|
3249
|
+
sleep(1)
|
3250
|
+
@driver.action.key_stroke('left')
|
3251
|
+
sleep(1)
|
3252
|
+
@driver.action.key_stroke('up')
|
3253
|
+
sleep(1)
|
3254
|
+
@driver.action.key_stroke('enter')
|
3255
|
+
sleep(1)
|
3256
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3257
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3258
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3259
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3260
|
+
end
|
3261
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3262
|
+
|
3263
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3264
|
+
sleep(2)
|
3265
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3266
|
+
sleep(2)
|
3267
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3268
|
+
sleep(1)
|
3269
|
+
rescue
|
3270
|
+
begin
|
3271
|
+
|
3272
|
+
@driver.find_element(:xpath, '//*[@id="spamcode_chk"]').click
|
3273
|
+
sleep(1)
|
3274
|
+
el2 = @driver.find_element(:xpath, '//*[@id="spamcode_chk"]')
|
3275
|
+
@driver.action.context_click(el2).perform
|
3276
|
+
|
3277
|
+
sleep(1)
|
3278
|
+
@driver.action.key_stroke('up')
|
3279
|
+
sleep(1)
|
3280
|
+
@driver.action.key_stroke('up')
|
3281
|
+
sleep(1)
|
3282
|
+
@driver.action.key_stroke('enter')
|
3283
|
+
sleep(1)
|
3284
|
+
begin
|
3285
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3286
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3287
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3288
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3289
|
+
rescue
|
3290
|
+
sleep(1)
|
3291
|
+
@driver.action.key_stroke('left')
|
3292
|
+
sleep(1)
|
3293
|
+
@driver.action.key_stroke('up')
|
3294
|
+
sleep(1)
|
3295
|
+
@driver.action.key_stroke('enter')
|
3296
|
+
sleep(1)
|
3297
|
+
# 요소 찾기 타임아웃을 7초로 설정
|
3298
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 7)
|
3299
|
+
#요소가 나타날 때까지 7초 동안 기다립니다.
|
3300
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]') }
|
3301
|
+
end
|
3302
|
+
puts '-[√] 캡챠 코드 타겟 완료2.......'.blue
|
3303
|
+
|
3304
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3305
|
+
sleep(2)
|
3306
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3307
|
+
sleep(2)
|
3308
|
+
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
3309
|
+
sleep(1)
|
3310
|
+
rescue
|
3311
|
+
|
3312
|
+
end
|
3313
|
+
end
|
3314
|
+
end
|
3315
|
+
end
|
3316
|
+
end
|
3317
|
+
end
|
3318
|
+
end
|
3319
|
+
end
|
3320
|
+
end
|
3321
|
+
end
|
2574
3322
|
end
|
2575
3323
|
end
|
2576
3324
|
end
|
@@ -2582,22 +3330,14 @@ rescue
|
|
2582
3330
|
end
|
2583
3331
|
end
|
2584
3332
|
end
|
2585
|
-
end
|
2586
|
-
end
|
2587
|
-
##<─────────────────────────────────────────────────────────────────────캡챠 해제 입력 코드 부분
|
2588
|
-
|
3333
|
+
end
|
2589
3334
|
|
2590
3335
|
|
2591
3336
|
|
2592
3337
|
sleep(1)
|
2593
3338
|
##캡챠 해제 입력 코드 부분─────────────────────────────────────────────────────────────────────>
|
2594
3339
|
begin
|
2595
|
-
|
2596
|
-
sleep(2)
|
2597
|
-
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2598
|
-
sleep(2)
|
2599
|
-
puts '-[√] 캡챠 해제 가능 유무 확인.......'.green
|
2600
|
-
sleep(1)
|
3340
|
+
|
2601
3341
|
# 타임아웃을 3초로 설정
|
2602
3342
|
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
2603
3343
|
# 요소가 나타날 때까지 30초 동안 기다립니다.
|
@@ -2609,22 +3349,22 @@ el_ready = @driver.find_element(:xpath, '//*[@data-state="ready"]')
|
|
2609
3349
|
sleep(1)
|
2610
3350
|
|
2611
3351
|
puts '-[√] 캡챠 해제 진행 중 (약 30~60 초 소요됩니다).......'.green
|
2612
|
-
begin
|
2613
|
-
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
2614
|
-
rescue
|
2615
3352
|
begin
|
2616
|
-
@driver.find_element(:xpath, '//*[@
|
3353
|
+
@driver.find_element(:xpath, '//*[@data-state="ready"]').click #캡챠우회버튼
|
2617
3354
|
rescue
|
2618
3355
|
begin
|
2619
|
-
@driver.find_element(:xpath, '//*[@class="captcha-solver-
|
3356
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-image"]').click #캡챠우회버튼
|
2620
3357
|
rescue
|
2621
3358
|
begin
|
2622
|
-
@driver.find_element(:xpath, '//*[@class="captcha-solver
|
3359
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver-info"]').click #캡챠우회버튼
|
2623
3360
|
rescue
|
3361
|
+
begin
|
3362
|
+
@driver.find_element(:xpath, '//*[@class="captcha-solver captcha-solver_inner"]').click #캡챠우회버튼
|
3363
|
+
rescue
|
3364
|
+
end
|
2624
3365
|
end
|
2625
3366
|
end
|
2626
3367
|
end
|
2627
|
-
end
|
2628
3368
|
|
2629
3369
|
|
2630
3370
|
sleep(10)
|
@@ -2641,7 +3381,7 @@ sleep(10)
|
|
2641
3381
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
2642
3382
|
end
|
2643
3383
|
end
|
2644
|
-
return 0
|
3384
|
+
#return 0
|
2645
3385
|
@driver.quit
|
2646
3386
|
rescue
|
2647
3387
|
# 타임아웃을 77초로 설정
|
@@ -2651,7 +3391,8 @@ sleep(10)
|
|
2651
3391
|
sleep(1)
|
2652
3392
|
@driver.find_element(:xpath, '//*[@data-state="solved"]').click
|
2653
3393
|
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다.......'.green
|
2654
|
-
|
3394
|
+
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다>.......'.green
|
3395
|
+
sleep(5)
|
2655
3396
|
begin
|
2656
3397
|
@driver.find_element(:xpath, '//*[@name="user_captcha"]').click
|
2657
3398
|
sleep(1)
|
@@ -2667,6 +3408,22 @@ sleep(10)
|
|
2667
3408
|
sleep(1)
|
2668
3409
|
@driver.action.key_down(:right).key_up(:right).perform
|
2669
3410
|
rescue
|
3411
|
+
begin
|
3412
|
+
#2차 확인 버튼 있을시
|
3413
|
+
puts '-[√] 캡챠 해제 완료 → 이어서 진행 합니다>>>.......'.green
|
3414
|
+
button = @driver.find_element(:xpath, '//input[@type="button" and @id="captch_button" and @value="확인"]')
|
3415
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", button)
|
3416
|
+
sleep(2)
|
3417
|
+
@driver.execute_script("arguments[0].click();", button)
|
3418
|
+
|
3419
|
+
begin
|
3420
|
+
wait = Selenium::WebDriver::Wait.new(timeout: 3)
|
3421
|
+
wait.until { @driver.switch_to.alert }
|
3422
|
+
@driver.switch_to.alert.accept
|
3423
|
+
rescue
|
3424
|
+
end
|
3425
|
+
rescue
|
3426
|
+
end
|
2670
3427
|
end
|
2671
3428
|
end
|
2672
3429
|
end
|
@@ -2675,6 +3432,19 @@ sleep(10)
|
|
2675
3432
|
rescue
|
2676
3433
|
puts '-[√] 캡챠 발생 없음.......'.green
|
2677
3434
|
end
|
3435
|
+
|
3436
|
+
|
3437
|
+
|
3438
|
+
|
3439
|
+
|
3440
|
+
|
3441
|
+
|
3442
|
+
|
3443
|
+
|
3444
|
+
else
|
3445
|
+
end
|
3446
|
+
|
3447
|
+
|
2678
3448
|
##<─────────────────────────────────────────────────────────────────────캡챠 해제 입력 코드 부분
|
2679
3449
|
|
2680
3450
|
##<─────────────────────────────────────────────────────────────────────캡챠 해제 입력 코드 부분
|
@@ -2692,30 +3462,35 @@ end
|
|
2692
3462
|
|
2693
3463
|
begin
|
2694
3464
|
@driver.find_element(:xpath, '//*[@id="btn_submit"]').click
|
2695
|
-
sleep(
|
3465
|
+
sleep(5)
|
2696
3466
|
rescue
|
2697
3467
|
begin
|
2698
3468
|
@driver.find_element(:xpath, '//*[@value="등록"]').click
|
2699
|
-
sleep(
|
3469
|
+
sleep(5)
|
2700
3470
|
rescue
|
2701
3471
|
begin
|
2702
3472
|
@driver.find_element(:xpath, '//*[@class="Mlangpage_member_start_box_btn"]').click
|
2703
|
-
sleep(
|
3473
|
+
sleep(5)
|
2704
3474
|
rescue
|
2705
3475
|
begin
|
2706
3476
|
@driver.find_element(:xpath, '//*[@value="회원가입"]').click
|
2707
|
-
sleep(
|
3477
|
+
sleep(5)
|
2708
3478
|
rescue
|
2709
3479
|
begin
|
2710
3480
|
@driver.find_element(:xpath, '//*[@name="sub"]').click
|
2711
|
-
sleep(
|
3481
|
+
sleep(5)
|
2712
3482
|
rescue
|
2713
3483
|
begin
|
2714
3484
|
@driver.find_element(:xpath, '//*[@class="metform-btn metform-submit-btn "]').click
|
2715
|
-
sleep(
|
3485
|
+
sleep(5)
|
2716
3486
|
rescue
|
2717
|
-
|
2718
|
-
|
3487
|
+
begin
|
3488
|
+
@driver.find_element(xpath: "//button[@class='btn-accent-lg' and @form='joinForm' and text()='회원가입']").click
|
3489
|
+
sleep(5)
|
3490
|
+
rescue
|
3491
|
+
@driver.action.key_down(:enter).key_up(:enter).perform
|
3492
|
+
sleep(5)
|
3493
|
+
end
|
2719
3494
|
end
|
2720
3495
|
end
|
2721
3496
|
end
|
@@ -2862,7 +3637,7 @@ login_url = option['login_url'].to_s
|
|
2862
3637
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
2863
3638
|
end
|
2864
3639
|
end
|
2865
|
-
return 0
|
3640
|
+
#return 0
|
2866
3641
|
@driver.quit
|
2867
3642
|
rescue
|
2868
3643
|
begin
|
@@ -2903,7 +3678,7 @@ login_url = option['login_url'].to_s
|
|
2903
3678
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
2904
3679
|
end
|
2905
3680
|
end
|
2906
|
-
return 0
|
3681
|
+
#return 0
|
2907
3682
|
@driver.quit
|
2908
3683
|
rescue
|
2909
3684
|
begin
|
@@ -2942,7 +3717,7 @@ login_url = option['login_url'].to_s
|
|
2942
3717
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
2943
3718
|
end
|
2944
3719
|
end
|
2945
|
-
return 0
|
3720
|
+
#return 0
|
2946
3721
|
@driver.quit
|
2947
3722
|
rescue
|
2948
3723
|
begin
|
@@ -2983,7 +3758,7 @@ login_url = option['login_url'].to_s
|
|
2983
3758
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
2984
3759
|
end
|
2985
3760
|
end
|
2986
|
-
return 0
|
3761
|
+
#return 0
|
2987
3762
|
@driver.quit
|
2988
3763
|
rescue
|
2989
3764
|
begin
|
@@ -4231,7 +5006,7 @@ begin
|
|
4231
5006
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
4232
5007
|
end
|
4233
5008
|
end
|
4234
|
-
return 0
|
5009
|
+
#return 0
|
4235
5010
|
@driver.quit
|
4236
5011
|
rescue
|
4237
5012
|
# 타임아웃을 77초로 설정
|
@@ -4598,7 +5373,7 @@ post_url = option['post_url'].to_s
|
|
4598
5373
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
4599
5374
|
end
|
4600
5375
|
end
|
4601
|
-
return 0
|
5376
|
+
#return 0
|
4602
5377
|
@driver.quit
|
4603
5378
|
rescue
|
4604
5379
|
begin
|
@@ -4644,7 +5419,7 @@ post_url = option['post_url'].to_s
|
|
4644
5419
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
4645
5420
|
end
|
4646
5421
|
end
|
4647
|
-
return 0
|
5422
|
+
#return 0
|
4648
5423
|
@driver.quit
|
4649
5424
|
rescue
|
4650
5425
|
begin
|
@@ -6702,7 +7477,7 @@ rescue Selenium::WebDriver::Error::WebDriverError => e
|
|
6702
7477
|
puts "크롬 브라우저 종료: #{e.message}"
|
6703
7478
|
end
|
6704
7479
|
end
|
6705
|
-
return 0
|
7480
|
+
#return 0
|
6706
7481
|
@driver.quit
|
6707
7482
|
end
|
6708
7483
|
end
|
@@ -8514,7 +9289,7 @@ if check_captcha == 1
|
|
8514
9289
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
8515
9290
|
end
|
8516
9291
|
end
|
8517
|
-
return 0
|
9292
|
+
#return 0
|
8518
9293
|
@driver.quit
|
8519
9294
|
rescue
|
8520
9295
|
# 타임아웃을 77초로 설정
|
@@ -8891,7 +9666,7 @@ if check_captcha == 0
|
|
8891
9666
|
el = @driver.find_element(:xpath, '//img[contains(@src, "norobot_image")]')
|
8892
9667
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
8893
9668
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
8894
|
-
puts '-[√] 캡챠 코드 code
|
9669
|
+
puts '-[√] 캡챠 코드 code 15.......'.red
|
8895
9670
|
sleep(1)
|
8896
9671
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
8897
9672
|
sleep(1)
|
@@ -8912,7 +9687,7 @@ if check_captcha == 0
|
|
8912
9687
|
el = @driver.find_element(:xpath, '//img[contains(@src, "code_graph")]')
|
8913
9688
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
8914
9689
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
8915
|
-
puts '-[√] 캡챠 코드 code
|
9690
|
+
puts '-[√] 캡챠 코드 code 16.......'.red
|
8916
9691
|
sleep(1)
|
8917
9692
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
8918
9693
|
sleep(1)
|
@@ -8933,7 +9708,7 @@ if check_captcha == 0
|
|
8933
9708
|
el = @driver.find_element(:xpath, '//img[contains(@src, "/captcha/images/image.php")]')
|
8934
9709
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
8935
9710
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
8936
|
-
puts '-[√] 캡챠 코드 code
|
9711
|
+
puts '-[√] 캡챠 코드 code 17.......'.red
|
8937
9712
|
sleep(1)
|
8938
9713
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
8939
9714
|
sleep(1)
|
@@ -8954,7 +9729,7 @@ if check_captcha == 0
|
|
8954
9729
|
el = @driver.find_element(:xpath, '//img[@id="protect_img"]')
|
8955
9730
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
8956
9731
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
8957
|
-
puts '-[√] 캡챠 코드 code
|
9732
|
+
puts '-[√] 캡챠 코드 code 18.......'.red
|
8958
9733
|
sleep(1)
|
8959
9734
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
8960
9735
|
sleep(1)
|
@@ -8974,7 +9749,7 @@ if check_captcha == 0
|
|
8974
9749
|
el = @driver.find_element(:xpath, '//img[contains(@src, "/captcha/")]')
|
8975
9750
|
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
8976
9751
|
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
8977
|
-
puts '-[√] 캡챠 코드 code
|
9752
|
+
puts '-[√] 캡챠 코드 code 19.......'.red
|
8978
9753
|
sleep(1)
|
8979
9754
|
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
8980
9755
|
sleep(1)
|
@@ -8989,7 +9764,28 @@ if check_captcha == 0
|
|
8989
9764
|
sleep(1)
|
8990
9765
|
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
8991
9766
|
rescue
|
8992
|
-
|
9767
|
+
begin
|
9768
|
+
@driver.switch_to.default_content()
|
9769
|
+
el = @driver.find_element(:xpath, '//*[@alt="captcha"]')
|
9770
|
+
puts '-[√] 캡챠 발견!! 캡차 해제를 위한 환경설정 약 10초 소요.......'.red
|
9771
|
+
puts '-[√] 캡챠 해제 중~ 해제 완료까지 마우스 움직이지 마세요.......'.red
|
9772
|
+
puts '-[√] 캡챠 코드 code 20.......'.red
|
9773
|
+
sleep(1)
|
9774
|
+
@driver.execute_script("arguments[0].scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'});", el) # 화면 가운데
|
9775
|
+
sleep(1)
|
9776
|
+
mouse_move_percentage(0.3,0.02)
|
9777
|
+
sleep(0.5)
|
9778
|
+
left_click
|
9779
|
+
sleep(1)
|
9780
|
+
@driver.switch_to.window(@driver.window_handle) #핸들 주입
|
9781
|
+
@driver.action.context_click(el).perform #우 클릭
|
9782
|
+
sleep(1)
|
9783
|
+
@driver.action.key_down(:shift).key_stroke('m').key_up(:shift).perform #단축키
|
9784
|
+
sleep(1)
|
9785
|
+
puts '-[√] 캡챠 코드 타겟 완료1.......'.blue
|
9786
|
+
rescue
|
9787
|
+
|
9788
|
+
end
|
8993
9789
|
|
8994
9790
|
end
|
8995
9791
|
|
@@ -10023,7 +10819,7 @@ sleep(10)
|
|
10023
10819
|
puts '-[√] 다음 작업 준비로 약 1초~60초 내외 시간이 소요됩니다.......'.red
|
10024
10820
|
end
|
10025
10821
|
end
|
10026
|
-
return 0
|
10822
|
+
#return 0
|
10027
10823
|
@driver.quit
|
10028
10824
|
rescue
|
10029
10825
|
# 타임아웃을 77초로 설정
|
@@ -11051,6 +11847,12 @@ end #반복루프
|
|
11051
11847
|
end
|
11052
11848
|
|
11053
11849
|
|
11850
|
+
begin #로그아웃
|
11851
|
+
puts "로그아웃 시도"
|
11852
|
+
@driver.find_element(xpath: "//*[contains(@class, 'btn') and contains(text(), '로그아웃')]").click
|
11853
|
+
sleep(3)
|
11854
|
+
rescue
|
11855
|
+
end
|
11054
11856
|
|
11055
11857
|
sleep(2)
|
11056
11858
|
|
@@ -11080,7 +11882,7 @@ end
|
|
11080
11882
|
|
11081
11883
|
end
|
11082
11884
|
|
11083
|
-
#end #반복루프
|
11885
|
+
#end #반복루프
|
11084
11886
|
class Wordpress
|
11085
11887
|
include Glimmer
|
11086
11888
|
def get_mac_address
|
@@ -11175,24 +11977,85 @@ class Wordpress
|
|
11175
11977
|
|
11176
11978
|
|
11177
11979
|
|
11178
|
-
def auto_image
|
11980
|
+
def auto_image(keyword = nil)
|
11981
|
+
keyword ||= @keyword
|
11982
|
+
puts "키워드: #{keyword}"
|
11983
|
+
|
11984
|
+
client = HTTPClient.new
|
11985
|
+
client.default_header = {
|
11986
|
+
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 '\
|
11987
|
+
'(KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36',
|
11988
|
+
'Accept' => 'application/json, text/javascript, */*; q=0.01',
|
11989
|
+
'Accept-Language' => 'en-US,en;q=0.9',
|
11990
|
+
'Referer' => "https://unsplash.com/s/photos/#{URI.encode_www_form_component(keyword)}",
|
11991
|
+
'X-Requested-With' => 'XMLHttpRequest'
|
11992
|
+
}
|
11993
|
+
|
11994
|
+
retry_count = 0
|
11995
|
+
max_retries = 10
|
11996
|
+
results = []
|
11997
|
+
|
11179
11998
|
begin
|
11180
11999
|
page = rand(1..15)
|
11181
|
-
|
11182
|
-
|
11183
|
-
|
11184
|
-
|
11185
|
-
|
12000
|
+
url = "https://unsplash.com/napi/search/photos?query=#{URI.encode_www_form_component(keyword)}&page=#{page}&per_page=20"
|
12001
|
+
puts "Request URL: #{url}"
|
12002
|
+
res = client.get(url)
|
12003
|
+
|
12004
|
+
unless res.status == 200
|
12005
|
+
puts "HTTP Error: #{res.status}"
|
12006
|
+
raise "HTTP Error"
|
11186
12007
|
end
|
11187
|
-
|
11188
|
-
|
11189
|
-
|
11190
|
-
|
11191
|
-
|
12008
|
+
|
12009
|
+
json = JSON.parse(res.body)
|
12010
|
+
results = json['results']
|
12011
|
+
mm = []
|
12012
|
+
|
12013
|
+
results.each do |photo|
|
12014
|
+
full_url = photo.dig('urls', 'full').to_s
|
12015
|
+
regular_url = photo.dig('urls', 'regular').to_s
|
12016
|
+
|
12017
|
+
if full_url.start_with?("https://images.unsplash.com/photo-") &&
|
12018
|
+
regular_url.include?("1080")
|
12019
|
+
mm << full_url
|
12020
|
+
end
|
12021
|
+
end
|
12022
|
+
|
12023
|
+
if mm.empty?
|
12024
|
+
raise "No matching image"
|
12025
|
+
end
|
12026
|
+
|
12027
|
+
selected_url = mm.sample
|
12028
|
+
Down.download(selected_url, destination: "./image/memory.png")
|
12029
|
+
puts "이미지 다운로드 완료: #{selected_url}"
|
12030
|
+
|
12031
|
+
rescue => e
|
12032
|
+
retry_count += 1
|
12033
|
+
puts "auto_image 에러: #{e.message} (재시도 #{retry_count}/#{max_retries})"
|
12034
|
+
sleep(3)
|
12035
|
+
if retry_count < max_retries
|
11192
12036
|
retry
|
12037
|
+
else
|
12038
|
+
puts "최대 재시도 초과. 조건 무시하고 랜덤 이미지 다운로드 시도..."
|
12039
|
+
|
12040
|
+
if results && !results.empty?
|
12041
|
+
random_photo = results.sample
|
12042
|
+
fallback_url = random_photo.dig('urls', 'full')
|
12043
|
+
if fallback_url
|
12044
|
+
Down.download(fallback_url, destination: "./image/memory.png")
|
12045
|
+
puts "랜덤 이미지 다운로드 완료: #{fallback_url}"
|
12046
|
+
else
|
12047
|
+
puts "랜덤 이미지 URL을 찾을 수 없습니다. 단색 배경 이미지 생성합니다."
|
12048
|
+
color_image
|
12049
|
+
end
|
12050
|
+
else
|
12051
|
+
puts "이미지 결과가 없어 다운로드할 수 없습니다. 단색 배경 이미지 생성합니다."
|
12052
|
+
color_image
|
12053
|
+
end
|
12054
|
+
end
|
11193
12055
|
end
|
11194
12056
|
end
|
11195
12057
|
|
12058
|
+
|
11196
12059
|
def color_image
|
11197
12060
|
color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
|
11198
12061
|
image = Magick::Image.new(740, 740) { |k| k.background_color = color.sample }
|