njongto_duo 0.0.5 → 0.0.30
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/njongto_duo.rb +55 -85
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757c4b20c244d01bf8faa8b57f4c83744a9960b1a439235227ca8822f72464a8
|
4
|
+
data.tar.gz: d4dca6482b460da6223cd97aab43704ad373b25f61b07e3104d22a83f4f39c18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32762708020522233b41c37c1e04c54d46f95ad24daf4c0ce361bf36fe4bc689cb3fb1ef307db5672c60ca135d3be8761ca8af1f56d06de469868fdaddf7a411
|
7
|
+
data.tar.gz: 9bb8263673b63595900509ef7e3a38c20bc899ace8f126d2df3c9b1181524ca7f27f2a656951e6379570ec575ea31171899fc89cbaf113b7d12a32a0071699f0
|
data/lib/njongto_duo.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'glimmer-dsl-libui'
|
2
2
|
require 'selenium-webdriver'
|
3
|
-
require 'webdrivers'
|
3
|
+
# require 'webdrivers'
|
4
4
|
require 'iconv'
|
5
5
|
require 'nokogiri'
|
6
6
|
require 'http'
|
@@ -21,6 +21,7 @@ include AutoClickMethods
|
|
21
21
|
using Rainbow
|
22
22
|
include Glimmer
|
23
23
|
|
24
|
+
|
24
25
|
class Naver
|
25
26
|
def initialize
|
26
27
|
@seed = 1
|
@@ -34,75 +35,61 @@ class Naver
|
|
34
35
|
def chrome_start(proxy, user_id)
|
35
36
|
naver_cookie_dir = "C:/naver_cookie"
|
36
37
|
FileUtils.mkdir_p(naver_cookie_dir) unless File.exist?(naver_cookie_dir)
|
37
|
-
|
38
38
|
if proxy == ''
|
39
|
-
begin
|
40
|
-
# webdrivers Gem이 크롬 드라이버 자동 다운로드 및 설정을 관리함
|
41
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
42
|
-
options.page_load_strategy = :normal
|
43
|
-
options.timeouts = { page_load: 20_000 }
|
44
|
-
options.page_load_strategy = 'none'
|
45
|
-
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
options.add_argument('--remote-debugging-port=9222')
|
50
|
-
options.add_argument("user-data-dir=#{naver_cookie_dir}/#{user_id}")
|
51
|
-
|
52
|
-
# :capabilities에 options를 배열로 전달
|
53
|
-
capabilities = [options]
|
54
|
-
|
55
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
56
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
57
|
-
rescue
|
58
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
59
|
-
capabilities = [options]
|
60
|
-
# 예외 발생 시 다른 방법으로 셀레니움 실행
|
61
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
62
|
-
end
|
63
|
-
else
|
64
|
-
begin
|
65
|
-
# Proxy를 사용하는 경우
|
66
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
67
|
-
options.add_argument '--proxy-server=' + proxy.to_s.force_encoding('utf-8')
|
68
|
-
options.page_load_strategy = :normal
|
69
|
-
options.timeouts = { page_load: 20_000 }
|
70
|
-
options.page_load_strategy = 'none'
|
71
|
-
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
72
|
-
|
73
|
-
options.add_argument('--remote-debugging-port=9222')
|
74
|
-
options.add_argument("user-data-dir=#{naver_cookie_dir}/#{user_id}")
|
75
|
-
|
76
|
-
# :capabilities에 options를 배열로 전달
|
77
|
-
capabilities = [options]
|
78
|
-
|
79
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
80
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
81
|
-
rescue => e
|
82
|
-
puts 'proxy error...'
|
83
39
|
begin
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
capabilities = [options]
|
95
|
-
|
96
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
40
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
41
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
42
|
+
options.page_load_strategy = :normal
|
43
|
+
options.timeouts = {page_load: 20_000}
|
44
|
+
options.page_load_strategy = 'none'
|
45
|
+
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
46
|
+
options.add_argument('--disable-gpu')
|
47
|
+
options.add_argument('--remote-debugging-port=9222')
|
48
|
+
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
49
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
|
97
50
|
rescue
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
51
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
|
52
|
+
end
|
53
|
+
else
|
54
|
+
begin
|
55
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
56
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
57
|
+
# profile = Selenium::WebDriver::Chrome::Profile.new
|
58
|
+
# profile['network.proxy.type'] = 1
|
59
|
+
# profile['network.proxy.http'] = proxy.split(':')[0]
|
60
|
+
# profile['network.proxy.http_port'] = proxy.split(':')[1].to_i
|
61
|
+
# options = Selenium::WebDriver::Chrome::Options.new
|
62
|
+
# options.profile = profile
|
63
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
64
|
+
options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
|
65
|
+
options.page_load_strategy = :normal
|
66
|
+
options.timeouts = {page_load: 20_000}
|
67
|
+
options.page_load_strategy = 'none'
|
68
|
+
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
69
|
+
options.add_argument('--disable-gpu')
|
70
|
+
options.add_argument('--remote-debugging-port=9222')
|
71
|
+
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
72
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
|
73
|
+
rescue => e
|
74
|
+
puts e
|
75
|
+
puts 'proxy error...'
|
76
|
+
begin
|
77
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
78
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
79
|
+
options.page_load_strategy = :normal
|
80
|
+
options.timeouts = {page_load: 20_000}
|
81
|
+
options.page_load_strategy = 'none'
|
82
|
+
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
83
|
+
options.add_argument('--disable-gpu')
|
84
|
+
options.add_argument('--remote-debugging-port=9222')
|
85
|
+
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
86
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
|
87
|
+
rescue
|
88
|
+
@driver = Selenium::WebDriver.for(:chrome, capabilities: options)
|
89
|
+
end
|
102
90
|
end
|
103
|
-
end
|
104
91
|
end
|
105
|
-
|
92
|
+
end
|
106
93
|
|
107
94
|
|
108
95
|
|
@@ -440,27 +427,10 @@ class Wordpress
|
|
440
427
|
@user_id = user_id
|
441
428
|
@user_pw = user_pw
|
442
429
|
begin
|
443
|
-
|
444
|
-
|
445
|
-
options.page_load_strategy = :normal
|
446
|
-
options.timeouts = {page_load: 20_000}
|
447
|
-
options.page_load_strategy = 'none'
|
448
|
-
options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
|
449
|
-
|
450
|
-
options.add_argument('--remote-debugging-port=9222')
|
451
|
-
options.add_argument('user-data-dir=C:/naver_cookie/' + user_id)
|
452
|
-
# :capabilities에 options를 배열로 전달
|
453
|
-
capabilities = [options]
|
454
|
-
|
455
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
456
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
430
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
431
|
+
@driver = Selenium::WebDriver.for :chrome
|
457
432
|
rescue
|
458
|
-
|
459
|
-
# :capabilities에 options를 배열로 전달
|
460
|
-
capabilities = [options]
|
461
|
-
|
462
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
463
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
433
|
+
@driver = Selenium::WebDriver.for :chrome
|
464
434
|
end
|
465
435
|
end
|
466
436
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: njongto_duo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|