posting_zon 0.0.60 → 0.0.61
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 +49 -8
- 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: 6f49d944350357c2ea579a545b8d8104db8a9ce38f0bf0dae274c74d6ff19978
|
4
|
+
data.tar.gz: fc1f6462bc84986656579b9527b9c36624335f4d531bc2a3e79e5a4dcd18d9a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4192acbe758204213c7f57c44a21a5dfc2f216295f3ba1e27c979db2c394f8dafef3022fc752ed6bdc2c66ec2f6a97b698a6cb202a56bb021c54c26c7e894f3e
|
7
|
+
data.tar.gz: 92e4fb419bfc45b4c73fe86f662eb9d0fb0216a0cf4c99bf2b80afb516373fad130543c4706e3ecdd37dfa69a17dcfdadde92b2ac99eaf9d715e510061a314ba
|
data/lib/posting_zon.rb
CHANGED
@@ -31,6 +31,7 @@ class Naver
|
|
31
31
|
def chrome_start(proxy)
|
32
32
|
if proxy == ''
|
33
33
|
begin
|
34
|
+
|
34
35
|
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
35
36
|
options = Selenium::WebDriver::Chrome::Options.new
|
36
37
|
options.add_extension('./crx/free.crx')
|
@@ -61,6 +62,7 @@ class Naver
|
|
61
62
|
|
62
63
|
# Selenium 4에서는 'capabilities'만 사용하는 방식
|
63
64
|
@driver = Selenium::WebDriver.for(:chrome, capabilities: [capabilities, options])
|
65
|
+
|
64
66
|
|
65
67
|
@driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: function(){ return false; }});") # 셀레니움 감지 방지
|
66
68
|
|
@@ -4106,7 +4108,16 @@ login_url = option['login_url'].to_s
|
|
4106
4108
|
puts '-[√] 글쓰기 버튼 code 3.......'.green
|
4107
4109
|
sleep(3.7)
|
4108
4110
|
rescue
|
4109
|
-
|
4111
|
+
begin
|
4112
|
+
el_post_btn = @driver.find_element(:xpath, '//*[@class="gRight"]')
|
4113
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", el_post_btn)
|
4114
|
+
sleep(1)
|
4115
|
+
@driver.find_element(:xpath, '//*[@class="gRight"]').click
|
4116
|
+
puts '-[√] 글쓰기 버튼 code 3.......'.green
|
4117
|
+
sleep(3.7)
|
4118
|
+
rescue
|
4119
|
+
|
4120
|
+
end
|
4110
4121
|
end
|
4111
4122
|
end
|
4112
4123
|
end
|
@@ -5096,7 +5107,12 @@ begin
|
|
5096
5107
|
@driver.find_element(:xpath, '//*[@name="nick_name"]').send_keys(user_id)
|
5097
5108
|
sleep(1)
|
5098
5109
|
rescue
|
5099
|
-
|
5110
|
+
begin
|
5111
|
+
@driver.find_element(:xpath, '//*[@name="write_name"]').send_keys(user_id)
|
5112
|
+
sleep(1)
|
5113
|
+
rescue
|
5114
|
+
|
5115
|
+
end
|
5100
5116
|
end
|
5101
5117
|
end
|
5102
5118
|
end
|
@@ -5786,16 +5802,18 @@ begin
|
|
5786
5802
|
puts '-[√] 제목 code 37.......'.yellow
|
5787
5803
|
|
5788
5804
|
|
5805
|
+
|
5806
|
+
|
5789
5807
|
rescue => e
|
5790
5808
|
puts '-[√] 제목 입력 항목 코드 탐색 실패!!.......'.red
|
5791
5809
|
puts '-[√] 다음 작업 준비 중으로 1~60 초 정도 기다려주세요.......'.red
|
5792
|
-
|
5810
|
+
|
5793
5811
|
@driver.window_handles.each do |handle|
|
5794
|
-
|
5812
|
+
@driver.switch_to.window(handle)
|
5795
5813
|
begin
|
5796
5814
|
# 로딩 중이거나, 페이지가 완전히 로딩되지 않더라도 탭을 닫기
|
5797
5815
|
@driver.close
|
5798
|
-
|
5816
|
+
|
5799
5817
|
rescue Selenium::WebDriver::Error::WebDriverError => e
|
5800
5818
|
puts "크롬 브라우저 종료: #{e.message}"
|
5801
5819
|
end
|
@@ -5803,8 +5821,10 @@ begin
|
|
5803
5821
|
return 0
|
5804
5822
|
@driver.quit
|
5805
5823
|
end
|
5824
|
+
|
5806
5825
|
|
5807
5826
|
|
5827
|
+
|
5808
5828
|
end
|
5809
5829
|
|
5810
5830
|
end
|
@@ -6029,6 +6049,7 @@ begin
|
|
6029
6049
|
html_bb = @driver.find_element(:xpath, '//*[@id="moreMisc-1"]')
|
6030
6050
|
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
|
6031
6051
|
sleep(1)
|
6052
|
+
|
6032
6053
|
@driver.find_element(:xpath, '//*[@id="moreMisc-1"]').click
|
6033
6054
|
sleep(1)
|
6034
6055
|
@driver.find_element(:xpath, '//*[@id="html-1"]').click
|
@@ -8628,8 +8649,28 @@ rescue
|
|
8628
8649
|
sleep(5)
|
8629
8650
|
|
8630
8651
|
rescue
|
8652
|
+
begin
|
8653
|
+
ss_button = @driver.find_element(:xpath, "//button[contains(text(), '글쓰기')]")
|
8654
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
8655
|
+
sleep(1)
|
8656
|
+
|
8657
|
+
@driver.find_element(:xpath, "//button[contains(text(), '글쓰기')]").click
|
8658
|
+
puts '-[√] 등록을 27번 코드로 시도하였습니다.......'.magenta
|
8659
|
+
sleep(5)
|
8660
|
+
|
8661
|
+
rescue
|
8662
|
+
begin
|
8663
|
+
ss_button = @driver.find_element(:xpath, '//*[@class="Button button-rounded black button-normal"]')
|
8664
|
+
@driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
|
8665
|
+
sleep(1)
|
8666
|
+
|
8667
|
+
@driver.find_element(:xpath, '//*[@class="Button button-rounded black button-normal"]').click
|
8668
|
+
puts '-[√] 등록을 28번 코드로 시도하였습니다.......'.magenta
|
8669
|
+
sleep(5)
|
8670
|
+
|
8671
|
+
rescue
|
8631
8672
|
|
8632
|
-
|
8673
|
+
|
8633
8674
|
########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
|
8634
8675
|
begin
|
8635
8676
|
puts '-[√] 등록 버튼 코드 탐색에 실패하였습니다.......'.magenta
|
@@ -8827,8 +8868,8 @@ rescue
|
|
8827
8868
|
|
8828
8869
|
|
8829
8870
|
|
8830
|
-
|
8831
|
-
|
8871
|
+
end
|
8872
|
+
end
|
8832
8873
|
end
|
8833
8874
|
end
|
8834
8875
|
end
|
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.
|
4
|
+
version: 0.0.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: posting app
|
14
14
|
email: mymin26@naver.com
|