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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/posting_zon.rb +12 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29d51c8c55e05d4fd727d91977476c2bece429e8f234aef51cea3ea7e62e60fd
4
- data.tar.gz: 5e4e4a834c3fcac779f2b8f0235caafc5f53cc6dceff2c9a55a3b1286884bd93
3
+ metadata.gz: b292f1aa782c927e934070c47d89c90480fecae9b346c259c3cc7e4fb13b8296
4
+ data.tar.gz: 2657a7e97dfa02ec0d7254ccde92df6cfc6d7856a8704fe3c1becd513c34db67
5
5
  SHA512:
6
- metadata.gz: 47bc9917572ea9f8fcae3615fe1e727566edc4fa0c10add28d0ae744844466db2a8bb530b7e78ae84deaee6a3eecf87e75d28dedfa9158e033396ae29b3e9b01
7
- data.tar.gz: 8a696eca4063eb9b3e24197f756160ed55bd9b8b7eab9d4537d9f844f7b755e9e9937d6fb73584fe8b20713546a8b9860b9e3d77c2934246654165a525f9e651
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 = :normal
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 = :normal
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 = :normal
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
- def login(proxy, captcha_key, board_cookie_dir = "C:/board_cookie")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.111.002
4
+ version: 3.111.003
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon