posting_zon 3.111.002 → 3.111.003
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 +12 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b292f1aa782c927e934070c47d89c90480fecae9b346c259c3cc7e4fb13b8296
|
4
|
+
data.tar.gz: 2657a7e97dfa02ec0d7254ccde92df6cfc6d7856a8704fe3c1becd513c34db67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c24c787c5e22ce059c4b6212e6d2627f53cf117fbb28384503421f4c8c4fa8450ee169c290b666d44a315f504bfdd4eb8520c0c5bde26436c6b41b260367a7c
|
7
|
+
data.tar.gz: 74a1b8b73e7f464b317690655fc5675f62eb153fbb662c1bd005ae1a2dd020dbb31720078cb7e385bf0544775cfd41b84f7a230e4752398cd56f4efa4a24d16d
|
data/lib/posting_zon.rb
CHANGED
@@ -69,9 +69,8 @@ class Naver
|
|
69
69
|
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
70
70
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
71
71
|
options.add_argument('--no-default-browser-check')
|
72
|
-
options.page_load_strategy =
|
72
|
+
options.page_load_strategy = 'normal'
|
73
73
|
options.timeouts = {page_load: 30_000}
|
74
|
-
options.page_load_strategy = 'none'
|
75
74
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
76
75
|
options.add_argument('--disable-gpu')
|
77
76
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -120,9 +119,8 @@ class Naver
|
|
120
119
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
121
120
|
options.add_argument('--no-default-browser-check')
|
122
121
|
options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
|
123
|
-
options.page_load_strategy =
|
122
|
+
options.page_load_strategy = 'normal'
|
124
123
|
options.timeouts = {page_load: 30_000}
|
125
|
-
options.page_load_strategy = 'none'
|
126
124
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
127
125
|
options.add_argument('--disable-gpu')
|
128
126
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -169,9 +167,8 @@ class Naver
|
|
169
167
|
options.add_argument('--disable-sync') # Chrome 동기화 비활성화
|
170
168
|
options.add_argument('--disable-popup-blocking') # 팝업 방지 (로그인 창이 뜨는 경우 대비)
|
171
169
|
options.add_argument('--no-default-browser-check')
|
172
|
-
options.page_load_strategy =
|
170
|
+
options.page_load_strategy = 'normal'
|
173
171
|
options.timeouts = {page_load: 30_000}
|
174
|
-
options.page_load_strategy = 'none'
|
175
172
|
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
176
173
|
options.add_argument('--disable-gpu')
|
177
174
|
options.add_argument('--remote-debugging-port=9222')
|
@@ -221,8 +218,15 @@ class Naver
|
|
221
218
|
end
|
222
219
|
end
|
223
220
|
end
|
221
|
+
|
222
|
+
def wait_for_page_load(timeout: 30)
|
223
|
+
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
224
|
+
wait.until { @driver.execute_script("return document.readyState") == "complete" }
|
225
|
+
rescue Selenium::WebDriver::Error::TimeoutError
|
226
|
+
puts "[!] 페이지 로딩이 30초 내 완료되지 않았습니다."
|
227
|
+
end
|
224
228
|
|
225
|
-
|
229
|
+
def login(proxy, captcha_key, board_cookie_dir = "C:/board_cookie")
|
226
230
|
@captcha_key = captcha_key
|
227
231
|
@board_cookie_dir = "C:/board_cookie"
|
228
232
|
current_dir = File.dirname(__FILE__)
|
@@ -252,7 +256,7 @@ class Naver
|
|
252
256
|
|
253
257
|
|
254
258
|
chrome_start(proxy, board_cookie_dir)
|
255
|
-
|
259
|
+
wait_for_page_load(timeout: 30)
|
256
260
|
|
257
261
|
target_url = "https://chromewebstore.google.com/detail/captcha-solver-auto-recog/ifibfemgeogfhoebkmokieepdoobkbpo?hl=ko"
|
258
262
|
|