added script for pulling Card name and set number from lorcanawiz

This commit is contained in:
0ceanSlim 2023-11-13 20:51:19 -05:00
parent 07645e33d0
commit 2a7dd3e69f
2 changed files with 280 additions and 0 deletions

63
saveList.py Normal file
View File

@ -0,0 +1,63 @@
from selenium import webdriver
import csv
import requests
import os
import zipfile
from io import BytesIO
from selenium.webdriver.common.by import By
def scrape_and_save_data(url, output_csv_path):
# Define the directory path and URLs for Chrome and Chromedriver
chrome_directory = 'c:/tmp/chrome'
chrome_exe_path = 'c:/tmp/chrome/chrome-win64/chrome.exe' # Modify this path as needed
chrome_url = 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5938.92/win64/chrome-win64.zip'
# Check if the Chrome directory exists, and if not, create it
if not os.path.exists(chrome_directory):
os.makedirs(chrome_directory)
# Check if Chrome.exe and Chromedriver.exe exist in the directory
if not os.path.exists(os.path.join(chrome_exe_path)):
# Download and extract Chrome
chrome_response = requests.get(chrome_url)
with zipfile.ZipFile(BytesIO(chrome_response.content), 'r') as zip_ref:
zip_ref.extractall(chrome_directory)
# Set up Chrome options
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = chrome_exe_path
# Set up the Selenium WebDriver
driver = webdriver.Chrome(options=chrome_options)
# Navigate to the webpage
driver.get(url)
# Find all elements with the specified class names
name_elements = driver.find_elements(By.CSS_SELECTOR, '.card-list-name-txt')
number_elements = driver.find_elements(By.CSS_SELECTOR, '.card-list-num')
# Extract data and store it in a list of dictionaries
data = [{'Name': name.text, 'Number': number.text} for name, number in zip(name_elements, number_elements)]
# Save data to CSV file
with open(output_csv_path, 'w', newline='', encoding='utf-8') as csv_file:
fieldnames = ['Name', 'Number']
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(data)
# Close the browser
driver.quit()
if __name__ == "__main__":
# Replace these values with your actual URL, ChromeDriver path, and output CSV path
webpage_url = 'https://www.lorcanawiz.com/cards/the-first-chapter'
output_csv_path = 'setlist1.csv'
# Call the function to scrape and save data
scrape_and_save_data(webpage_url, output_csv_path)

217
setlist1.csv Normal file
View File

@ -0,0 +1,217 @@
Name,Number
Ariel,1
Ariel,2
Cinderella,3
Goofy,4
Hades,5
Hades,6
HeiHei,7
LeFou,8
Lilo,9
Maximus,10
Maximus,11
Mickey Mouse,12
Minnie Mouse,13
Moana,14
Mr. Smee,15
Prince Phillip,16
Pumbaa,17
Rapunzel,18
Sebastian,19
Simba,20
Stitch,21
Stitch,22
Stitch,23
Timon,24
Be Our Guest,25
Control Your Temper!,26
Hakuna Matata,27
Healing Glow,28
Just in Time,29
Part of Your World,30
You Have Forgotten Me,31
Dinglehopper,32
Lantern,33
Ursulas Shell Necklace,34
Anna,35
Archimedes,36
Dr. Facilier,37
Dr. Facilier,38
Dr. Facilier,39
Elsa,40
Elsa,41
Elsa,42
Flotsam,43
Jafar,44
Jafar,45
Jetsam,46
Magic Broom,47
Maleficent,48
Maleficent,49
Marshmallow,50
Mickey Mouse,51
Olaf,52
Pascal,53
Rafiki,54
Sven,55
The Queen,56
The Wardrobe,57
Tinker Bell,58
Ursula,59
Yzma,60
Zeus,61
Befuddle,62
Freeze,63
Friends on the Other Side,64
Reflection,65
Magic Mirror,66
Ursulas Cauldron,67
White Rabbits Pocket Watch,68
Aladdin,69
Beast,70
Cheshire Cat,71
Cruella De Vil,72
Duke of Weselton,73
Flynn Rider,74
Genie,75
Genie,76
Genie,77
Hans,78
Horace,79
Iago,80
Jasper,81
John Silver,82
Jumba Jookiba,83
Kuzco,84
Lady Tremaine,85
Mad Hatter,86
Megara,87
Mickey Mouse,88
Mickey Mouse,89
Mother Gothel,90
Peter Pan,91
Tamatoa,92
Tinker Bell,93
Do It Again!,94
Mother Knows Best,95
Stampede,96
Steal from the Rich,97
Sudden Chill,98
The Beast is Mine!,99
Vicious Betrayal,100
Dr. Faciliers Cards,101
Stolen Scimitar,102
Abu,103
Aladdin,104
Aladdin,105
Captain,106
Captain Hook,107
Donald Duck,108
Elsa,109
Gaston,110
Goofy,111
LeFou,112
Maleficent,113
Maui,114
Mickey Mouse,115
Minnie Mouse,116
Moana,117
Mulan,118
Peter Pan,119
Pongo,120
Rapunzel,121
Scar,122
Scar,123
Sergeant Tibbs,124
Stitch,125
Te Kā,126
Tigger,127
Be Prepared,128
Cut to the Chase,129
Dragon Fire,130
Fan the Flames,131
He's Got a Sword!,132
Tangle,133
Poisoned Apple,134
Shield of Virtue,135
Sword of Truth,136
Ariel,137
Aurora,138
Aurora,139
Aurora,140
Belle,141
Belle,142
Chief Tui,143
Donald Duck,144
Flounder,145
Gramma Tala,146
Hades,147
Jasmine,148
Jasmine,149
Maleficent,150
Maleficent,151
Maurice,152
Merlin,153
Mickey Mouse,154
Mufasa,155
Philoctetes,156
Robin Hood,157
Scar,158
Tamatoa,159
Triton,160
Develop Your Brain,161
If its Not Baroque,162
Let It Go,163
One Jump Ahead,164
Work Together,165
Coconut Basket,166
Eye of the Fates,167
Fishbone Quill,168
Magic Golden Flower,169
Scepter of Arendelle,170
Aladdin,171
Beast,172
Captain Hook,173
Captain Hook,174
Captain Hook,175
Cerberus,176
Donald Duck,177
Gantu,178
Goons,179
Hans,180
Hercules,181
Kristoff,182
Kronk,183
Lilo,184
Maui,185
Mickey Mouse,186
Prince Eric,187
Simba,188
Simba,189
Simba,190
Starkey,191
Te Kā,192
Tinker Bell,193
Tinker Bell,194
A Whole New World,195
Break,196
Fire the Cannons!,197
Grab Your Sword,198
Ransack,199
Smash,200
Beasts Mirror,201
Frying Pan,202
Musketeer Tabard,203
Plasma Blaster,204
Hades,205
Stitch,206
Elsa,207
Mickey Mouse,208
Genie,209
Mickey Mouse,210
Aladdin,211
Maui,212
Aurora,213
Belle,214
Simba,215
Tinker Bell,216
1 Name Number
2 Ariel 1
3 Ariel 2
4 Cinderella 3
5 Goofy 4
6 Hades 5
7 Hades 6
8 HeiHei 7
9 LeFou 8
10 Lilo 9
11 Maximus 10
12 Maximus 11
13 Mickey Mouse 12
14 Minnie Mouse 13
15 Moana 14
16 Mr. Smee 15
17 Prince Phillip 16
18 Pumbaa 17
19 Rapunzel 18
20 Sebastian 19
21 Simba 20
22 Stitch 21
23 Stitch 22
24 Stitch 23
25 Timon 24
26 Be Our Guest 25
27 Control Your Temper! 26
28 Hakuna Matata 27
29 Healing Glow 28
30 Just in Time 29
31 Part of Your World 30
32 You Have Forgotten Me 31
33 Dinglehopper 32
34 Lantern 33
35 Ursula’s Shell Necklace 34
36 Anna 35
37 Archimedes 36
38 Dr. Facilier 37
39 Dr. Facilier 38
40 Dr. Facilier 39
41 Elsa 40
42 Elsa 41
43 Elsa 42
44 Flotsam 43
45 Jafar 44
46 Jafar 45
47 Jetsam 46
48 Magic Broom 47
49 Maleficent 48
50 Maleficent 49
51 Marshmallow 50
52 Mickey Mouse 51
53 Olaf 52
54 Pascal 53
55 Rafiki 54
56 Sven 55
57 The Queen 56
58 The Wardrobe 57
59 Tinker Bell 58
60 Ursula 59
61 Yzma 60
62 Zeus 61
63 Befuddle 62
64 Freeze 63
65 Friends on the Other Side 64
66 Reflection 65
67 Magic Mirror 66
68 Ursula’s Cauldron 67
69 White Rabbit’s Pocket Watch 68
70 Aladdin 69
71 Beast 70
72 Cheshire Cat 71
73 Cruella De Vil 72
74 Duke of Weselton 73
75 Flynn Rider 74
76 Genie 75
77 Genie 76
78 Genie 77
79 Hans 78
80 Horace 79
81 Iago 80
82 Jasper 81
83 John Silver 82
84 Jumba Jookiba 83
85 Kuzco 84
86 Lady Tremaine 85
87 Mad Hatter 86
88 Megara 87
89 Mickey Mouse 88
90 Mickey Mouse 89
91 Mother Gothel 90
92 Peter Pan 91
93 Tamatoa 92
94 Tinker Bell 93
95 Do It Again! 94
96 Mother Knows Best 95
97 Stampede 96
98 Steal from the Rich 97
99 Sudden Chill 98
100 The Beast is Mine! 99
101 Vicious Betrayal 100
102 Dr. Facilier’s Cards 101
103 Stolen Scimitar 102
104 Abu 103
105 Aladdin 104
106 Aladdin 105
107 Captain 106
108 Captain Hook 107
109 Donald Duck 108
110 Elsa 109
111 Gaston 110
112 Goofy 111
113 LeFou 112
114 Maleficent 113
115 Maui 114
116 Mickey Mouse 115
117 Minnie Mouse 116
118 Moana 117
119 Mulan 118
120 Peter Pan 119
121 Pongo 120
122 Rapunzel 121
123 Scar 122
124 Scar 123
125 Sergeant Tibbs 124
126 Stitch 125
127 Te Kā 126
128 Tigger 127
129 Be Prepared 128
130 Cut to the Chase 129
131 Dragon Fire 130
132 Fan the Flames 131
133 He's Got a Sword! 132
134 Tangle 133
135 Poisoned Apple 134
136 Shield of Virtue 135
137 Sword of Truth 136
138 Ariel 137
139 Aurora 138
140 Aurora 139
141 Aurora 140
142 Belle 141
143 Belle 142
144 Chief Tui 143
145 Donald Duck 144
146 Flounder 145
147 Gramma Tala 146
148 Hades 147
149 Jasmine 148
150 Jasmine 149
151 Maleficent 150
152 Maleficent 151
153 Maurice 152
154 Merlin 153
155 Mickey Mouse 154
156 Mufasa 155
157 Philoctetes 156
158 Robin Hood 157
159 Scar 158
160 Tamatoa 159
161 Triton 160
162 Develop Your Brain 161
163 If it’s Not Baroque 162
164 Let It Go 163
165 One Jump Ahead 164
166 Work Together 165
167 Coconut Basket 166
168 Eye of the Fates 167
169 Fishbone Quill 168
170 Magic Golden Flower 169
171 Scepter of Arendelle 170
172 Aladdin 171
173 Beast 172
174 Captain Hook 173
175 Captain Hook 174
176 Captain Hook 175
177 Cerberus 176
178 Donald Duck 177
179 Gantu 178
180 Goons 179
181 Hans 180
182 Hercules 181
183 Kristoff 182
184 Kronk 183
185 Lilo 184
186 Maui 185
187 Mickey Mouse 186
188 Prince Eric 187
189 Simba 188
190 Simba 189
191 Simba 190
192 Starkey 191
193 Te Kā 192
194 Tinker Bell 193
195 Tinker Bell 194
196 A Whole New World 195
197 Break 196
198 Fire the Cannons! 197
199 Grab Your Sword 198
200 Ransack 199
201 Smash 200
202 Beast’s Mirror 201
203 Frying Pan 202
204 Musketeer Tabard 203
205 Plasma Blaster 204
206 Hades 205
207 Stitch 206
208 Elsa 207
209 Mickey Mouse 208
210 Genie 209
211 Mickey Mouse 210
212 Aladdin 211
213 Maui 212
214 Aurora 213
215 Belle 214
216 Simba 215
217 Tinker Bell 216