cafe_buy 0.0.9 → 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_buy.rb +41 -21
- 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: a86fd000140b3a3a5db6827a4a73c9a68ced4ecbacd6b7a6fa95ad7f4601ab1d
|
4
|
+
data.tar.gz: e38102572fcc00a289100f373170460202c053b19e62bc467bb92bd0ed37da17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b964534a9fc2fb759a744f383acdd260bc46617d8166027033c6b89e69ac6de68b6b2439e642995c46dcc7c45c95194ca002acb7dc4f6030530074c38ab808
|
7
|
+
data.tar.gz: 8a3958c6f18aa106293a28bc4358d0308e89c4ea49bec8944d739bc87eb9be206c01637a9c8a290ced282356cecc2e1e53d6d08d3027e3e0bb5e46a043b135cf
|
data/lib/cafe_buy.rb
CHANGED
@@ -1040,20 +1040,43 @@ end
|
|
1040
1040
|
if i2.to_s.include?('<img')
|
1041
1041
|
path = i2.to_s.split('src="')[1].split('"')[0]
|
1042
1042
|
path = URI.decode_www_form(path)[0][0]
|
1043
|
+
# 이미지 등록 버튼 클릭
|
1043
1044
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[1]/button').click
|
1044
|
-
sleep(2)
|
1045
|
-
Clipboard.copy(path.split('/').join("\\"))
|
1046
|
-
key_down('ctrl')
|
1047
|
-
key_stroke('v')
|
1048
|
-
key_up('ctrl')
|
1049
1045
|
sleep(3)
|
1050
|
-
key_stroke('
|
1046
|
+
key_stroke('escape')
|
1047
|
+
|
1048
|
+
# 파일 경로 변환 (슬래시 -> 백슬래시)
|
1049
|
+
file_path = path.split('/').join("\\") # 윈도우 스타일 경로로 변환
|
1050
|
+
|
1051
|
+
# 파일 입력 필드 찾기 (input[type="file"])
|
1052
|
+
file_input = @driver.find_element(:id, 'hidden-file')
|
1053
|
+
|
1054
|
+
# send_keys로 파일 경로를 직접 입력하여 파일 업로드
|
1055
|
+
file_input.send_keys(file_path)
|
1051
1056
|
sleep(3)
|
1052
|
-
|
1057
|
+
|
1058
|
+
|
1059
|
+
|
1060
|
+
begin
|
1061
|
+
@driver.action.key_down(:up).key_up(:up).perform
|
1062
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 3)
|
1063
|
+
#요소가 나타날 때까지 60초 동안 기다립니다.
|
1064
|
+
wait.until { @driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]') }
|
1065
|
+
sleep(1)
|
1066
|
+
@driver.find_element(:xpath, '//*[@class="se-placeholder __se_placeholder se-ff-system se-fs13"]').click
|
1067
|
+
sleep(1)
|
1068
|
+
@driver.action.send_keys(title).perform
|
1069
|
+
sleep(1)
|
1070
|
+
@driver.action.key_down(:enter).key_up(:enter).perform #엔터
|
1071
|
+
sleep(1)
|
1072
|
+
rescue
|
1073
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
1074
|
+
end
|
1075
|
+
|
1053
1076
|
|
1054
1077
|
if i2.to_s.split('href="')[1] != nil
|
1055
1078
|
href2 = i2.to_s.split('href="')[1].split('"')[0]
|
1056
|
-
|
1079
|
+
@driver.action.key_down(:up).key_up(:up).perform
|
1057
1080
|
sleep(1)
|
1058
1081
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[7]/div/button').click
|
1059
1082
|
sleep(1)
|
@@ -1126,14 +1149,13 @@ end
|
|
1126
1149
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[1]/ul/li[5]/div/div/button['+select_number+']').click
|
1127
1150
|
sleep(1)
|
1128
1151
|
Clipboard.copy(i2.text)
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
sleep(3)
|
1152
|
+
sleep(1)
|
1153
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
1154
|
+
sleep(1)
|
1133
1155
|
|
1134
|
-
|
1156
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
1135
1157
|
sleep(1)
|
1136
|
-
|
1158
|
+
@driver.action.key_down(:down).key_up(:down).perform
|
1137
1159
|
sleep(1)
|
1138
1160
|
@driver.action.key_down(:enter).key_up(:enter).perform
|
1139
1161
|
|
@@ -1528,7 +1550,7 @@ end
|
|
1528
1550
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/header/div[2]/ul/li[15]/div/div/button').click
|
1529
1551
|
end
|
1530
1552
|
sleep(1)
|
1531
|
-
|
1553
|
+
@driver.action.key_down(:arrow_right).key_up(:arrow_right).perform
|
1532
1554
|
sleep(1)
|
1533
1555
|
end
|
1534
1556
|
end
|
@@ -1582,9 +1604,8 @@ end
|
|
1582
1604
|
sleep(3)
|
1583
1605
|
# @driver.action.send_keys(soosick_1.text).perform
|
1584
1606
|
Clipboard.copy(soosick_1.to_s)
|
1585
|
-
|
1586
|
-
|
1587
|
-
key_up('ctrl')
|
1607
|
+
sleep(1)
|
1608
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
1588
1609
|
sleep(2)
|
1589
1610
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
|
1590
1611
|
sleep(3)
|
@@ -1602,9 +1623,8 @@ end
|
|
1602
1623
|
sleep(3)
|
1603
1624
|
# @driver.action.send_keys(soosick_2).perform
|
1604
1625
|
Clipboard.copy(soosick_2.to_s)
|
1605
|
-
|
1606
|
-
|
1607
|
-
key_up('ctrl')
|
1626
|
+
sleep(1)
|
1627
|
+
@driver.action.key_down(:control).send_keys('v').key_up(:control).perform
|
1608
1628
|
sleep(2)
|
1609
1629
|
@driver.find_element(:xpath, '//*[@id="'+page_id+'"]/div[1]/div/div[4]/div[2]/div/div/div[3]/div/button[2]').click
|
1610
1630
|
sleep(3)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cafe_buy
|
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
|