posting_zon 0.0.10 → 0.0.15

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 +89 -75
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b81b4aadd9026d0304ba0f9f768dc0970a4c21f24589b4fe86301a4c1da81d6
4
- data.tar.gz: f9707534daf78fe9cfa209970e2bc0f47ea3fe69e321525fbc79cc5409a8605c
3
+ metadata.gz: 32e7e6e3eec3266844140dae770b3a6f2c4dc921c7a49217d428525553d56e0f
4
+ data.tar.gz: a760148ab99d7913ab29ffa6311a244dafb39944319f308de30dbaad56cd39a6
5
5
  SHA512:
6
- metadata.gz: 10c53d0b3ca651824838d200c432e543445bf591d01bbc0dda2d54375736f8eef00fad564f85a75ce85c0266e60d6002cf790562780840f9a9560f7a27e80490
7
- data.tar.gz: 4c2d5b82e282aefa18138311b0316cb718070c4d5116a5075d5af83b16f5619ed8a59e7b284d610abf17e9e37f22b089a82e7eda34ca442f88c513074ba7c5db
6
+ metadata.gz: da505f0712967cd337b43aa37b728e1d3f33fbd289e48e8c878bde70d1353fd037b546f2ee20df978711bd02820c9cfa5c51ebbe52da7881340a41ba359ca0a6
7
+ data.tar.gz: bcccf4281df69f6fa723b44c5964bc509681b587c17c32593fb70c2cce8149418a367175c159c091dd19cc0d34397f45adf19b563788106a7755c9c3c6a21de0
data/lib/posting_zon.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 'open-uri'
@@ -34,98 +34,111 @@ class Naver
34
34
  def chrome_start(proxy)
35
35
  if proxy == ''
36
36
  begin
37
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
37
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
38
+
38
39
  options = Selenium::WebDriver::Chrome::Options.new #(options: {"excludeSwitches" => ["enable-automation"]}) #자동화된 테스트...제거(options: {"excludeSwitches" => ["enable-automation"]})
39
40
  options.add_extension('./crx/free.crx')
40
41
  options.add_extension('./crx/app.crx')
41
- options.page_load_strategy = :normal
42
- options.timeouts = {page_load: 20_000}
42
+
43
43
  options.add_argument('--start-maximized')
44
44
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
45
-
46
- #options.add_argument('--disable-blink-features=AutomationControlled')
47
- #options.add_argument('--disable-popup-blocking')
48
- #options.add_argument('--dns-prefetch-disable')
49
- #options.add_argument('--disable-dev-shm-usage')
50
- #options.add_argument('--disable-software-rasterizer')
51
- #options.add_argument('--ignore-certificate-errors')
52
- #options.add_argument('--disable-gpu') # GPU가속 끄기
53
- #options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
54
- #options.add_argument('--disable-web-security')
55
- #options.add_argument('--allow-running-insecure-content')
56
- #options.add_argument('--ignore-certificate-errors')
57
- #options.add_argument('--allow-insecure-localhost')
58
- #options.add_argument('--no-sandbox')
59
- #options.add_argument('--disable-translate')
60
- #options.add_argument('--disable-extensions-file-access-check')
61
- #options.add_argument('--disable-impl-side-painting')
62
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
45
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
46
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
47
+ options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
48
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
49
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
50
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
51
+
52
+ # 자동화된 테스트 제거
53
+ options.exclude_switches = ['enable-automation']
54
+
55
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
56
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
57
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
58
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
59
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
60
+ # `capabilities` 사용
61
+ capabilities = [options]
62
+
63
+ # 드라이버 초기화 (capabilities 사용)
64
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
65
+
63
66
  rescue
64
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
67
+ # `capabilities` 사용
68
+ capabilities = [options]
69
+
70
+ # 드라이버 초기화 (capabilities 사용)
71
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
65
72
  end
66
73
  else
67
74
  begin
68
75
  puts '프록시 연결합니다.......'.magenta
69
76
  puts '프록시 연결시 프록시 서버에 의해 인터넷속도가 낮아질수있어.......'.magenta
70
77
  puts '원활한 작업이 되지않을수있습니다.......'.magenta
71
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
78
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
72
79
  options = Selenium::WebDriver::Chrome::Options.new
73
80
  options.add_argument '--proxy-server='+proxy.to_s.force_encoding('utf-8').to_s
74
81
  options.add_extension('./crx/free.crx')
75
82
  options.add_extension('./crx/app.crx')
76
- options.page_load_strategy = :normal
77
- options.timeouts = {page_load: 20_000}
83
+
78
84
  options.add_argument('--start-maximized')
79
85
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
80
-
81
- #options.add_argument('--disable-blink-features=AutomationControlled')
82
- #options.add_argument('--disable-popup-blocking')
83
- #options.add_argument('--dns-prefetch-disable')
84
- #options.add_argument('--disable-dev-shm-usage')
85
- #options.add_argument('--disable-software-rasterizer')
86
- #options.add_argument('--ignore-certificate-errors')
87
- #options.add_argument('--disable-gpu') # GPU가속 끄기
88
- #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
89
- #options.add_argument('--disable-web-security')
90
- #options.add_argument('--allow-running-insecure-content')
91
- #options.add_argument('--ignore-certificate-errors')
92
- #options.add_argument('--allow-insecure-localhost')
93
- #options.add_argument('--no-sandbox')
94
- #options.add_argument('--disable-translate')
95
- #options.add_argument('--disable-extensions-file-access-check')
96
- #options.add_argument('--disable-impl-side-painting')
97
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
86
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
87
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
88
+ options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
89
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
90
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
91
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
92
+
93
+ # 자동화된 테스트 제거
94
+ options.exclude_switches = ['enable-automation']
95
+
96
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
97
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
98
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
99
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
100
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
101
+ # `capabilities` 사용
102
+ capabilities = [options]
103
+
104
+ # 드라이버 초기화 (capabilities 사용)
105
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
98
106
  rescue => e
99
107
  puts e
100
108
  puts 'proxy error...'
101
109
  begin
102
- Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
110
+ #Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
103
111
  options.add_extension('./crx/free.crx')
104
112
  options.add_extension('./crx/app.crx')
105
- options.page_load_strategy = :normal
106
- options.timeouts = {page_load: 20_000}
113
+
107
114
  options.add_argument('--start-maximized')
108
115
  options.add_argument('user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.59 Safari/537.36') # user-agent 위조
109
-
110
- #options.add_argument('--disable-blink-features=AutomationControlled')
111
- #options.add_argument('--disable-popup-blocking')
112
- #options.add_argument('--dns-prefetch-disable')
113
- #options.add_argument('--disable-dev-shm-usage')
114
- #options.add_argument('--disable-software-rasterizer')
115
- #options.add_argument('--ignore-certificate-errors')
116
- #options.add_argument('--disable-gpu') # GPU가속 끄기
117
- #options.excludeSwitches('enable-automation') #자동화된 테스트...제거
118
- #options.add_argument('--disable-web-security')
119
- #options.add_argument('--allow-running-insecure-content')
120
- #options.add_argument('--ignore-certificate-errors')
121
- #options.add_argument('--allow-insecure-localhost')
122
- #options.add_argument('--no-sandbox')
123
- #options.add_argument('--disable-translate')
124
- #options.add_argument('--disable-extensions-file-access-check')
125
- #options.add_argument('--disable-impl-side-painting')
126
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
116
+ options.add_argument('--disable-blink-features=AutomationControlled') #자동화된 환경에서 실행되는 것을 감지하는 기능을 비활성화합니다.
117
+ options.add_argument('--ignore-certificate-errors') #SSL 인증서 오류를 무시하도록 설정합니다
118
+ options.excludeSwitches('--enable-automation') #자동화된 테스트...제거
119
+ options.add_argument('--disable-web-security') #웹 보안을 비활성화합니다
120
+ options.add_argument('--allow-running-insecure-content') #HTTPS 사이트에서 HTTP 컨텐츠를 실행할 수 있도록 허용합니다.
121
+ options.add_argument('--no-sandbox') #Chrome에서 샌드박스 모드를 비활성화합니다.
122
+
123
+ # 자동화된 테스트 제거
124
+ options.exclude_switches = ['enable-automation']
125
+
126
+ options.add_preference("profile.password_manager_enabled", false) # 비밀번호 관리자 비활성화
127
+ options.add_preference("credentials_enable_service", false) # 비밀번호 저장 기능 비활성화
128
+ #options.add_preference("profile.managed_default_content_settings.cookies", 2) # 쿠키 관련 팝업 차단
129
+ options.add_preference("profile.default_content_setting_values.notifications", 2) # 알림 차단
130
+ options.add_argument("--disable-save-password-bubble") # 비밀번호 저장 팝업 차단
131
+ # `capabilities` 사용
132
+ capabilities = [options]
133
+
134
+ # 드라이버 초기화 (capabilities 사용)
135
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
127
136
  rescue
128
- @driver = Selenium::WebDriver.for(:chrome, capabilities: options)
137
+ # `capabilities` 사용
138
+ capabilities = [options]
139
+
140
+ # 드라이버 초기화 (capabilities 사용)
141
+ @driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
129
142
  end
130
143
  end
131
144
  end
@@ -8193,6 +8206,15 @@ rescue
8193
8206
  sleep(5)
8194
8207
 
8195
8208
  rescue
8209
+ begin
8210
+ @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').send_keys()
8211
+ sleep(2)
8212
+
8213
+ @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').click
8214
+ puts '-[√] 등록을 24번 코드로 시도하였습니다.......'.magenta
8215
+ sleep(5)
8216
+
8217
+ rescue
8196
8218
  begin
8197
8219
  @driver.find_element(:xpath, '//*[@type="submit"]').send_keys()
8198
8220
  sleep(2)
@@ -8220,15 +8242,7 @@ rescue
8220
8242
  sleep(5)
8221
8243
 
8222
8244
  rescue
8223
- begin
8224
- @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').send_keys()
8225
- sleep(2)
8226
-
8227
- @driver.find_element(:xpath, '//*[@class="btn_blue btn_svc write"]').click
8228
- puts '-[√] 등록을 24번 코드로 시도하였습니다.......'.magenta
8229
- sleep(5)
8230
-
8231
- rescue
8245
+
8232
8246
 
8233
8247
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
8234
8248
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: posting app
14
14
  email: mymin26@naver.com