cafe_basics 0.0.7 → 0.0.10
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/cafe_basics.rb +49 -20
- 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: 505bf46600ff44b7eec13f790a8cae9b68b78e673bce0c996cef862d871e2259
|
4
|
+
data.tar.gz: 2f8e0a276c7d3f5701961d16a8018f1211f01fad9f2fe16ce7d24b0cf38213fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24f45b8bc126c864be4eaf14c644f57ff02a83804350a3e89c027a4073b017ce04201b8afff37f9915fffd8ff8fe36b9085b3d94f46b5aff3a2cacd00a50a1fc
|
7
|
+
data.tar.gz: 442cfcc44606c0205b70fca5069473f069cece50160445c43e3eabf3408e3ea0f35f71d1f284ad3a3a4df893eab2d84904961c56a6df025ff95576f818c1e2f5
|
data/lib/cafe_basics.rb
CHANGED
@@ -721,20 +721,43 @@ class Naver
|
|
721
721
|
if i2.to_s.include?('<img')
|
722
722
|
path = i2.to_s.split('src="')[1].split('"')[0]
|
723
723
|
path = URI.decode_www_form(path)[0][0]
|
724
|
+
# 이미지 등록 버튼 클릭
|
724
725
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[1]/button').click
|
725
|
-
sleep(2)
|
726
|
-
Clipboard.copy(path.split('/').join("\\"))
|
727
|
-
key_down('ctrl')
|
728
|
-
key_stroke('v')
|
729
|
-
key_up('ctrl')
|
730
726
|
sleep(3)
|
731
|
-
key_stroke('
|
727
|
+
key_stroke('escape')
|
728
|
+
|
729
|
+
# 파일 경로 변환 (슬래시 -> 백슬래시)
|
730
|
+
file_path = path.split('/').join("\\") # 윈도우 스타일 경로로 변환
|
731
|
+
|
732
|
+
# 파일 입력 필드 찾기 (input[type="file"])
|
733
|
+
file_input = @driver.find_element(:id, 'hidden-file')
|
734
|
+
|
735
|
+
# send_keys로 파일 경로를 직접 입력하여 파일 업로드
|
736
|
+
file_input.send_keys(file_path)
|
732
737
|
sleep(3)
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
begin
|
742
|
+
@driver.action.key_down(:up).key_up(:up).perform
|
743
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
744
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
745
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]') }
|
746
|
+
sleep(1)
|
747
|
+
@driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]').click
|
748
|
+
sleep(1)
|
749
|
+
@driver.action.send_keys(title).perform
|
750
|
+
sleep(1)
|
751
|
+
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
752
|
+
sleep(1)
|
753
|
+
rescue
|
754
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
755
|
+
end
|
733
756
|
|
734
757
|
|
735
758
|
if i2.to_s.split('href="')[1] != nil
|
736
759
|
href2 = i2.to_s.split('href="')[1].split('"')[0]
|
737
|
-
|
760
|
+
@driver.action.key_down(:up).key_up(:up).perform
|
738
761
|
sleep(1)
|
739
762
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[7]/div/button').click
|
740
763
|
sleep(1)
|
@@ -782,11 +805,20 @@ class Naver
|
|
782
805
|
sleep(3)
|
783
806
|
@driver.action.key_down(:up).key_up(:up).perform #x탭
|
784
807
|
sleep(1)
|
808
|
+
begin
|
809
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
810
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
811
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]') }
|
812
|
+
sleep(1)
|
785
813
|
@driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]').click
|
814
|
+
sleep(1)
|
786
815
|
@driver.action.send_keys(title).perform
|
787
816
|
sleep(1)
|
788
817
|
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
789
818
|
sleep(1)
|
819
|
+
rescue
|
820
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
821
|
+
end
|
790
822
|
|
791
823
|
elsif i2.to_s.include?('<inyonggoo')
|
792
824
|
if i2.text == ''
|
@@ -798,14 +830,13 @@ class Naver
|
|
798
830
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[5]/div/div/button['+select_number+']').click
|
799
831
|
sleep(1)
|
800
832
|
Clipboard.copy(i2.text)
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
sleep(3)
|
833
|
+
sleep(1)
|
834
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
835
|
+
sleep(1)
|
805
836
|
|
806
|
-
|
837
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
807
838
|
sleep(1)
|
808
|
-
|
839
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
809
840
|
sleep(1)
|
810
841
|
@driver.action.key_down(:enter).key_up(:enter).perform
|
811
842
|
|
@@ -1202,7 +1233,7 @@ class Naver
|
|
1202
1233
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[15]/div/div/button').click
|
1203
1234
|
end
|
1204
1235
|
sleep(1)
|
1205
|
-
|
1236
|
+
@driver.action.key_down(:arrow_right).key_up(:arrow_right).perform
|
1206
1237
|
sleep(1)
|
1207
1238
|
end
|
1208
1239
|
end
|
@@ -1256,9 +1287,8 @@ class Naver
|
|
1256
1287
|
sleep(3)
|
1257
1288
|
# @driver.action.send_keys(soosick_1.text).perform
|
1258
1289
|
Clipboard.copy(soosick_1.to_s)
|
1259
|
-
|
1260
|
-
|
1261
|
-
key_up('ctrl')
|
1290
|
+
sleep(1)
|
1291
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
1262
1292
|
sleep(2)
|
1263
1293
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
|
1264
1294
|
sleep(3)
|
@@ -1276,9 +1306,8 @@ class Naver
|
|
1276
1306
|
sleep(3)
|
1277
1307
|
# @driver.action.send_keys(soosick_2).perform
|
1278
1308
|
Clipboard.copy(soosick_2.to_s)
|
1279
|
-
|
1280
|
-
|
1281
|
-
key_up('ctrl')
|
1309
|
+
sleep(1)
|
1310
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
1282
1311
|
sleep(2)
|
1283
1312
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
|
1284
1313
|
sleep(3)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_basics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|