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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"nbformat": 4,
|
3 |
+
"nbformat_minor": 0,
|
4 |
+
"metadata": {
|
5 |
+
"colab": {
|
6 |
+
"provenance": []
|
7 |
+
},
|
8 |
+
"kernelspec": {
|
9 |
+
"name": "python3",
|
10 |
+
"display_name": "Python 3"
|
11 |
+
},
|
12 |
+
"language_info": {
|
13 |
+
"name": "python"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"cells": [
|
17 |
+
{
|
18 |
+
"cell_type": "markdown",
|
19 |
+
"source": [
|
20 |
+
" # Create the dataset for the chatbox about League of Legends Lore\n",
|
21 |
+
" Author: **HOANG Caroline**\n",
|
22 |
+
"\n",
|
23 |
+
" The notebook is setup and runnable for Google Collab"
|
24 |
+
],
|
25 |
+
"metadata": {
|
26 |
+
"id": "AUdgpvdZDa2l"
|
27 |
+
}
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"cell_type": "markdown",
|
31 |
+
"source": [
|
32 |
+
"## 1. Setup"
|
33 |
+
],
|
34 |
+
"metadata": {
|
35 |
+
"id": "ZMtrx1lED6_D"
|
36 |
+
}
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"cell_type": "markdown",
|
40 |
+
"source": [
|
41 |
+
"Chrome Installation"
|
42 |
+
],
|
43 |
+
"metadata": {
|
44 |
+
"id": "KtlLmE3cD_hS"
|
45 |
+
}
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"cell_type": "code",
|
49 |
+
"execution_count": 1,
|
50 |
+
"metadata": {
|
51 |
+
"id": "bULR-49jDSDU",
|
52 |
+
"colab": {
|
53 |
+
"base_uri": "https://localhost:8080/"
|
54 |
+
},
|
55 |
+
"outputId": "232a6f85-099b-4cbd-e053-002dc700c836"
|
56 |
+
},
|
57 |
+
"outputs": [
|
58 |
+
{
|
59 |
+
"output_type": "stream",
|
60 |
+
"name": "stdout",
|
61 |
+
"text": [
|
62 |
+
"Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n",
|
63 |
+
"Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]\n",
|
64 |
+
"Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]\n",
|
65 |
+
"Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]\n",
|
66 |
+
"Get:5 https://r2u.stat.illinois.edu/ubuntu jammy InRelease [6,555 B]\n",
|
67 |
+
"Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease [1,581 B]\n",
|
68 |
+
"Get:7 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]\n",
|
69 |
+
"Hit:8 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n",
|
70 |
+
"Hit:9 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n",
|
71 |
+
"Hit:10 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n",
|
72 |
+
"Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [3,830 kB]\n",
|
73 |
+
"Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2,957 kB]\n",
|
74 |
+
"Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,533 kB]\n",
|
75 |
+
"Get:14 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,664 kB]\n",
|
76 |
+
"Get:15 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [8,708 kB]\n",
|
77 |
+
"Get:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages [1,321 kB]\n",
|
78 |
+
"Get:17 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,235 kB]\n",
|
79 |
+
"Get:18 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [3,688 kB]\n",
|
80 |
+
"Get:19 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,649 kB]\n",
|
81 |
+
"Fetched 29.0 MB in 10s (2,897 kB/s)\n",
|
82 |
+
"Reading package lists...\n",
|
83 |
+
"W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n",
|
84 |
+
"Reading package lists... Done\n",
|
85 |
+
"Building dependency tree... Done\n",
|
86 |
+
"Reading state information... Done\n",
|
87 |
+
"curl is already the newest version (7.81.0-1ubuntu1.20).\n",
|
88 |
+
"unzip is already the newest version (6.0-26ubuntu3.2).\n",
|
89 |
+
"wget is already the newest version (1.21.2-2ubuntu1.1).\n",
|
90 |
+
"0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.\n",
|
91 |
+
"--2025-02-28 19:43:10-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\n",
|
92 |
+
"Resolving dl.google.com (dl.google.com)... 142.251.167.136, 142.251.167.190, 142.251.167.93, ...\n",
|
93 |
+
"Connecting to dl.google.com (dl.google.com)|142.251.167.136|:443... connected.\n",
|
94 |
+
"HTTP request sent, awaiting response... 200 OK\n",
|
95 |
+
"Length: 113752568 (108M) [application/x-debian-package]\n",
|
96 |
+
"Saving to: ‘google-chrome-stable_current_amd64.deb’\n",
|
97 |
+
"\n",
|
98 |
+
"google-chrome-stabl 100%[===================>] 108.48M 247MB/s in 0.4s \n",
|
99 |
+
"\n",
|
100 |
+
"2025-02-28 19:43:12 (247 MB/s) - ‘google-chrome-stable_current_amd64.deb’ saved [113752568/113752568]\n",
|
101 |
+
"\n",
|
102 |
+
"Selecting previously unselected package google-chrome-stable.\n",
|
103 |
+
"(Reading database ... 124947 files and directories currently installed.)\n",
|
104 |
+
"Preparing to unpack google-chrome-stable_current_amd64.deb ...\n",
|
105 |
+
"Unpacking google-chrome-stable (133.0.6943.141-1) ...\n",
|
106 |
+
"\u001b[1mdpkg:\u001b[0m dependency problems prevent configuration of google-chrome-stable:\n",
|
107 |
+
" google-chrome-stable depends on libvulkan1; however:\n",
|
108 |
+
" Package libvulkan1 is not installed.\n",
|
109 |
+
"\n",
|
110 |
+
"\u001b[1mdpkg:\u001b[0m error processing package google-chrome-stable (--install):\n",
|
111 |
+
" dependency problems - leaving unconfigured\n",
|
112 |
+
"Processing triggers for mailcap (3.70+nmu1ubuntu1) ...\n",
|
113 |
+
"Processing triggers for man-db (2.10.2-1) ...\n",
|
114 |
+
"Errors were encountered while processing:\n",
|
115 |
+
" google-chrome-stable\n",
|
116 |
+
"Reading package lists... Done\n",
|
117 |
+
"Building dependency tree... Done\n",
|
118 |
+
"Reading state information... Done\n",
|
119 |
+
"Correcting dependencies... Done\n",
|
120 |
+
"The following additional packages will be installed:\n",
|
121 |
+
" libvulkan1 mesa-vulkan-drivers\n",
|
122 |
+
"The following NEW packages will be installed:\n",
|
123 |
+
" libvulkan1 mesa-vulkan-drivers\n",
|
124 |
+
"0 upgraded, 2 newly installed, 0 to remove and 30 not upgraded.\n",
|
125 |
+
"1 not fully installed or removed.\n",
|
126 |
+
"Need to get 10.9 MB of archives.\n",
|
127 |
+
"After this operation, 51.3 MB of additional disk space will be used.\n",
|
128 |
+
"Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libvulkan1 amd64 1.3.204.1-2 [128 kB]\n",
|
129 |
+
"Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mesa-vulkan-drivers amd64 23.2.1-1ubuntu3.1~22.04.3 [10.7 MB]\n",
|
130 |
+
"Fetched 10.9 MB in 1s (10.1 MB/s)\n",
|
131 |
+
"Selecting previously unselected package libvulkan1:amd64.\n",
|
132 |
+
"(Reading database ... 125064 files and directories currently installed.)\n",
|
133 |
+
"Preparing to unpack .../libvulkan1_1.3.204.1-2_amd64.deb ...\n",
|
134 |
+
"Unpacking libvulkan1:amd64 (1.3.204.1-2) ...\n",
|
135 |
+
"Selecting previously unselected package mesa-vulkan-drivers:amd64.\n",
|
136 |
+
"Preparing to unpack .../mesa-vulkan-drivers_23.2.1-1ubuntu3.1~22.04.3_amd64.deb ...\n",
|
137 |
+
"Unpacking mesa-vulkan-drivers:amd64 (23.2.1-1ubuntu3.1~22.04.3) ...\n",
|
138 |
+
"Setting up libvulkan1:amd64 (1.3.204.1-2) ...\n",
|
139 |
+
"Setting up mesa-vulkan-drivers:amd64 (23.2.1-1ubuntu3.1~22.04.3) ...\n",
|
140 |
+
"Setting up google-chrome-stable (133.0.6943.141-1) ...\n",
|
141 |
+
"update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode\n",
|
142 |
+
"update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode\n",
|
143 |
+
"update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode\n",
|
144 |
+
"Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n",
|
145 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n",
|
146 |
+
"\n",
|
147 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n",
|
148 |
+
"\n",
|
149 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n",
|
150 |
+
"\n",
|
151 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n",
|
152 |
+
"\n",
|
153 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n",
|
154 |
+
"\n",
|
155 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n",
|
156 |
+
"\n",
|
157 |
+
"/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n",
|
158 |
+
"\n",
|
159 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n",
|
160 |
+
"\n",
|
161 |
+
"/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n",
|
162 |
+
"\n",
|
163 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n",
|
164 |
+
"\n",
|
165 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n",
|
166 |
+
"\n",
|
167 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n",
|
168 |
+
"\n",
|
169 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n",
|
170 |
+
"\n",
|
171 |
+
"Reading package lists... Done\n",
|
172 |
+
"Building dependency tree... Done\n",
|
173 |
+
"Reading state information... Done\n",
|
174 |
+
"libasound2 is already the newest version (1.2.6.1-1ubuntu1).\n",
|
175 |
+
"libasound2 set to manually installed.\n",
|
176 |
+
"libxi6 is already the newest version (2:1.8-1build1).\n",
|
177 |
+
"libxi6 set to manually installed.\n",
|
178 |
+
"libxss1 is already the newest version (1:1.2.3-1build2).\n",
|
179 |
+
"libxss1 set to manually installed.\n",
|
180 |
+
"libnss3 is already the newest version (2:3.98-0ubuntu0.22.04.2).\n",
|
181 |
+
"libnss3 set to manually installed.\n",
|
182 |
+
"libx11-dev is already the newest version (2:1.7.5-1ubuntu0.3).\n",
|
183 |
+
"libx11-dev set to manually installed.\n",
|
184 |
+
"libx11-xcb1 is already the newest version (2:1.7.5-1ubuntu0.3).\n",
|
185 |
+
"libx11-xcb1 set to manually installed.\n",
|
186 |
+
"Suggested packages:\n",
|
187 |
+
" indicator-application\n",
|
188 |
+
"The following NEW packages will be installed:\n",
|
189 |
+
" gconf-service gconf-service-backend gconf2-common libappindicator3-1 libdbus-glib-1-2\n",
|
190 |
+
" libdbusmenu-glib4 libdbusmenu-gtk3-4 libgconf-2-4 libglu1-mesa libxtst6\n",
|
191 |
+
"0 upgraded, 10 newly installed, 0 to remove and 30 not upgraded.\n",
|
192 |
+
"Need to get 1,184 kB of archives.\n",
|
193 |
+
"After this operation, 9,107 kB of additional disk space will be used.\n",
|
194 |
+
"Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbus-glib-1-2 amd64 0.112-2build1 [65.4 kB]\n",
|
195 |
+
"Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf2-common all 3.2.6-7ubuntu2 [698 kB]\n",
|
196 |
+
"Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libgconf-2-4 amd64 3.2.6-7ubuntu2 [86.0 kB]\n",
|
197 |
+
"Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf-service-backend amd64 3.2.6-7ubuntu2 [59.3 kB]\n",
|
198 |
+
"Get:5 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf-service amd64 3.2.6-7ubuntu2 [17.4 kB]\n",
|
199 |
+
"Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbusmenu-glib4 amd64 16.04.1+18.10.20180917-0ubuntu8 [45.4 kB]\n",
|
200 |
+
"Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbusmenu-gtk3-4 amd64 16.04.1+18.10.20180917-0ubuntu8 [31.0 kB]\n",
|
201 |
+
"Get:8 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libappindicator3-1 amd64 12.10.1+20.10.20200706.1-0ubuntu1 [23.2 kB]\n",
|
202 |
+
"Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxtst6 amd64 2:1.2.3-1build4 [13.4 kB]\n",
|
203 |
+
"Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libglu1-mesa amd64 9.0.2-1 [145 kB]\n",
|
204 |
+
"Fetched 1,184 kB in 1s (1,549 kB/s)\n",
|
205 |
+
"Selecting previously unselected package libdbus-glib-1-2:amd64.\n",
|
206 |
+
"(Reading database ... 125102 files and directories currently installed.)\n",
|
207 |
+
"Preparing to unpack .../0-libdbus-glib-1-2_0.112-2build1_amd64.deb ...\n",
|
208 |
+
"Unpacking libdbus-glib-1-2:amd64 (0.112-2build1) ...\n",
|
209 |
+
"Selecting previously unselected package gconf2-common.\n",
|
210 |
+
"Preparing to unpack .../1-gconf2-common_3.2.6-7ubuntu2_all.deb ...\n",
|
211 |
+
"Unpacking gconf2-common (3.2.6-7ubuntu2) ...\n",
|
212 |
+
"Selecting previously unselected package libgconf-2-4:amd64.\n",
|
213 |
+
"Preparing to unpack .../2-libgconf-2-4_3.2.6-7ubuntu2_amd64.deb ...\n",
|
214 |
+
"Unpacking libgconf-2-4:amd64 (3.2.6-7ubuntu2) ...\n",
|
215 |
+
"Selecting previously unselected package gconf-service-backend.\n",
|
216 |
+
"Preparing to unpack .../3-gconf-service-backend_3.2.6-7ubuntu2_amd64.deb ...\n",
|
217 |
+
"Unpacking gconf-service-backend (3.2.6-7ubuntu2) ...\n",
|
218 |
+
"Selecting previously unselected package gconf-service.\n",
|
219 |
+
"Preparing to unpack .../4-gconf-service_3.2.6-7ubuntu2_amd64.deb ...\n",
|
220 |
+
"Unpacking gconf-service (3.2.6-7ubuntu2) ...\n",
|
221 |
+
"Selecting previously unselected package libdbusmenu-glib4:amd64.\n",
|
222 |
+
"Preparing to unpack .../5-libdbusmenu-glib4_16.04.1+18.10.20180917-0ubuntu8_amd64.deb ...\n",
|
223 |
+
"Unpacking libdbusmenu-glib4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n",
|
224 |
+
"Selecting previously unselected package libdbusmenu-gtk3-4:amd64.\n",
|
225 |
+
"Preparing to unpack .../6-libdbusmenu-gtk3-4_16.04.1+18.10.20180917-0ubuntu8_amd64.deb ...\n",
|
226 |
+
"Unpacking libdbusmenu-gtk3-4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n",
|
227 |
+
"Selecting previously unselected package libappindicator3-1.\n",
|
228 |
+
"Preparing to unpack .../7-libappindicator3-1_12.10.1+20.10.20200706.1-0ubuntu1_amd64.deb ...\n",
|
229 |
+
"Unpacking libappindicator3-1 (12.10.1+20.10.20200706.1-0ubuntu1) ...\n",
|
230 |
+
"Selecting previously unselected package libxtst6:amd64.\n",
|
231 |
+
"Preparing to unpack .../8-libxtst6_2%3a1.2.3-1build4_amd64.deb ...\n",
|
232 |
+
"Unpacking libxtst6:amd64 (2:1.2.3-1build4) ...\n",
|
233 |
+
"Selecting previously unselected package libglu1-mesa:amd64.\n",
|
234 |
+
"Preparing to unpack .../9-libglu1-mesa_9.0.2-1_amd64.deb ...\n",
|
235 |
+
"Unpacking libglu1-mesa:amd64 (9.0.2-1) ...\n",
|
236 |
+
"Setting up libxtst6:amd64 (2:1.2.3-1build4) ...\n",
|
237 |
+
"Setting up libdbusmenu-glib4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n",
|
238 |
+
"Setting up gconf2-common (3.2.6-7ubuntu2) ...\n",
|
239 |
+
"\n",
|
240 |
+
"Creating config file /etc/gconf/2/path with new version\n",
|
241 |
+
"Setting up libdbus-glib-1-2:amd64 (0.112-2build1) ...\n",
|
242 |
+
"Setting up libglu1-mesa:amd64 (9.0.2-1) ...\n",
|
243 |
+
"Setting up libdbusmenu-gtk3-4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n",
|
244 |
+
"Setting up libgconf-2-4:amd64 (3.2.6-7ubuntu2) ...\n",
|
245 |
+
"Setting up libappindicator3-1 (12.10.1+20.10.20200706.1-0ubuntu1) ...\n",
|
246 |
+
"Setting up gconf-service (3.2.6-7ubuntu2) ...\n",
|
247 |
+
"Setting up gconf-service-backend (3.2.6-7ubuntu2) ...\n",
|
248 |
+
"Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n",
|
249 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n",
|
250 |
+
"\n",
|
251 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n",
|
252 |
+
"\n",
|
253 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n",
|
254 |
+
"\n",
|
255 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n",
|
256 |
+
"\n",
|
257 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n",
|
258 |
+
"\n",
|
259 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n",
|
260 |
+
"\n",
|
261 |
+
"/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n",
|
262 |
+
"\n",
|
263 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n",
|
264 |
+
"\n",
|
265 |
+
"/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n",
|
266 |
+
"\n",
|
267 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n",
|
268 |
+
"\n",
|
269 |
+
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n",
|
270 |
+
"\n",
|
271 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n",
|
272 |
+
"\n",
|
273 |
+
"/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n",
|
274 |
+
"\n",
|
275 |
+
"Archive: chromedriver_linux64.zip\n",
|
276 |
+
" inflating: chromedriver \n",
|
277 |
+
" inflating: LICENSE.chromedriver \n"
|
278 |
+
]
|
279 |
+
}
|
280 |
+
],
|
281 |
+
"source": [
|
282 |
+
"# Install Chrome\n",
|
283 |
+
"!apt-get update -q\n",
|
284 |
+
"!apt-get install -y wget curl unzip\n",
|
285 |
+
"!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\n",
|
286 |
+
"!dpkg -i google-chrome-stable_current_amd64.deb\n",
|
287 |
+
"!apt --fix-broken install -y\n",
|
288 |
+
"\n",
|
289 |
+
"# Install dependencies for Chrome\n",
|
290 |
+
"!apt-get install -y libx11-dev libx11-xcb1 libglu1-mesa libxi6 libgconf-2-4 libnss3 libxss1 libappindicator3-1 libasound2 libxtst6\n",
|
291 |
+
"\n",
|
292 |
+
"# Install ChromeDriver\n",
|
293 |
+
"!wget -q https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip\n",
|
294 |
+
"!unzip chromedriver_linux64.zip\n",
|
295 |
+
"!mv chromedriver /usr/bin/chromedriver\n",
|
296 |
+
"!chmod +x /usr/bin/chromedriver"
|
297 |
+
]
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"cell_type": "markdown",
|
301 |
+
"source": [
|
302 |
+
"Packages"
|
303 |
+
],
|
304 |
+
"metadata": {
|
305 |
+
"id": "8yLARgacEDjR"
|
306 |
+
}
|
307 |
+
},
|
308 |
+
{
|
309 |
+
"cell_type": "code",
|
310 |
+
"source": [
|
311 |
+
"pip install selenium webdriver-manager"
|
312 |
+
],
|
313 |
+
"metadata": {
|
314 |
+
"id": "Hb2k8Lh1EEbn",
|
315 |
+
"colab": {
|
316 |
+
"base_uri": "https://localhost:8080/"
|
317 |
+
},
|
318 |
+
"outputId": "7cec1b5a-f78b-48d9-89be-7dcced16ec3b"
|
319 |
+
},
|
320 |
+
"execution_count": 5,
|
321 |
+
"outputs": [
|
322 |
+
{
|
323 |
+
"output_type": "stream",
|
324 |
+
"name": "stdout",
|
325 |
+
"text": [
|
326 |
+
"Requirement already satisfied: selenium in /usr/local/lib/python3.11/dist-packages (4.29.0)\n",
|
327 |
+
"Requirement already satisfied: webdriver-manager in /usr/local/lib/python3.11/dist-packages (4.0.2)\n",
|
328 |
+
"Requirement already satisfied: urllib3<3,>=1.26 in /usr/local/lib/python3.11/dist-packages (from urllib3[socks]<3,>=1.26->selenium) (2.3.0)\n",
|
329 |
+
"Requirement already satisfied: trio~=0.17 in /usr/local/lib/python3.11/dist-packages (from selenium) (0.29.0)\n",
|
330 |
+
"Requirement already satisfied: trio-websocket~=0.9 in /usr/local/lib/python3.11/dist-packages (from selenium) (0.12.2)\n",
|
331 |
+
"Requirement already satisfied: certifi>=2021.10.8 in /usr/local/lib/python3.11/dist-packages (from selenium) (2025.1.31)\n",
|
332 |
+
"Requirement already satisfied: typing_extensions~=4.9 in /usr/local/lib/python3.11/dist-packages (from selenium) (4.12.2)\n",
|
333 |
+
"Requirement already satisfied: websocket-client~=1.8 in /usr/local/lib/python3.11/dist-packages (from selenium) (1.8.0)\n",
|
334 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (2.32.3)\n",
|
335 |
+
"Requirement already satisfied: python-dotenv in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (1.0.1)\n",
|
336 |
+
"Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (24.2)\n",
|
337 |
+
"Requirement already satisfied: attrs>=23.2.0 in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (25.1.0)\n",
|
338 |
+
"Requirement already satisfied: sortedcontainers in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (2.4.0)\n",
|
339 |
+
"Requirement already satisfied: idna in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (3.10)\n",
|
340 |
+
"Requirement already satisfied: outcome in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (1.3.0.post0)\n",
|
341 |
+
"Requirement already satisfied: sniffio>=1.3.0 in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (1.3.1)\n",
|
342 |
+
"Requirement already satisfied: wsproto>=0.14 in /usr/local/lib/python3.11/dist-packages (from trio-websocket~=0.9->selenium) (1.2.0)\n",
|
343 |
+
"Requirement already satisfied: pysocks!=1.5.7,<2.0,>=1.5.6 in /usr/local/lib/python3.11/dist-packages (from urllib3[socks]<3,>=1.26->selenium) (1.7.1)\n",
|
344 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->webdriver-manager) (3.4.1)\n",
|
345 |
+
"Requirement already satisfied: h11<1,>=0.9.0 in /usr/local/lib/python3.11/dist-packages (from wsproto>=0.14->trio-websocket~=0.9->selenium) (0.14.0)\n"
|
346 |
+
]
|
347 |
+
}
|
348 |
+
]
|
349 |
+
},
|
350 |
+
{
|
351 |
+
"cell_type": "markdown",
|
352 |
+
"source": [
|
353 |
+
"## 2. Retrieve texts from website\n",
|
354 |
+
"\n",
|
355 |
+
"###Methodology\n",
|
356 |
+
"1. Get all the champions name from https://leagueoflegends.fandom.com/wiki/List_of_champions and store it as a list using BeautifulSoul. As it also extract the champion role this can be used as extra information. \\\\\n",
|
357 |
+
"2. For each champion {champion_name} we will go to https://universe.leagueoflegends.com/en_GB/story/champion/{champion_name}/ and extract the story text using BeautifulSoup. The name of the champion will go through a process to fit the url. \\\\\n",
|
358 |
+
"BeautifulSoup extract the HTML text faster than Selenium. However, it sometimes fail to find the story text (such as Aurora, Ambessa) as it doesn't appear. In that case we will use Selenium.\n",
|
359 |
+
"3. We create a dataframe that include the name of the champion associated with its role and story."
|
360 |
+
],
|
361 |
+
"metadata": {
|
362 |
+
"id": "fy-ph5nDEoWp"
|
363 |
+
}
|
364 |
+
},
|
365 |
+
{
|
366 |
+
"cell_type": "markdown",
|
367 |
+
"source": [
|
368 |
+
"## Step 1: Collect champions name"
|
369 |
+
],
|
370 |
+
"metadata": {
|
371 |
+
"id": "fj2MCu5WGyDw"
|
372 |
+
}
|
373 |
+
},
|
374 |
+
{
|
375 |
+
"cell_type": "code",
|
376 |
+
"source": [
|
377 |
+
"import requests\n",
|
378 |
+
"from bs4 import BeautifulSoup\n",
|
379 |
+
"\n",
|
380 |
+
"# URL of the list of champions\n",
|
381 |
+
"url = \"https://leagueoflegends.fandom.com/wiki/List_of_champions\"\n",
|
382 |
+
"\n",
|
383 |
+
"# Send a GET request to fetch the page\n",
|
384 |
+
"response = requests.get(url)\n",
|
385 |
+
"\n",
|
386 |
+
"# Parse the HTML content using BeautifulSoup\n",
|
387 |
+
"soup = BeautifulSoup(response.text, 'html.parser')\n",
|
388 |
+
"\n",
|
389 |
+
"# Find all td tags with the data-sort-value attribute\n",
|
390 |
+
"champion_td_tags = soup.find_all('td', attrs={'data-sort-value': True})\n",
|
391 |
+
"\n",
|
392 |
+
"# Extract the champion names from the data-sort-value attribute\n",
|
393 |
+
"champions = [tag['data-sort-value'] for tag in champion_td_tags]"
|
394 |
+
],
|
395 |
+
"metadata": {
|
396 |
+
"id": "c3ckS_EpGz20"
|
397 |
+
},
|
398 |
+
"execution_count": 6,
|
399 |
+
"outputs": []
|
400 |
+
},
|
401 |
+
{
|
402 |
+
"cell_type": "code",
|
403 |
+
"source": [
|
404 |
+
"# Create champions name and role list from the previous extraction\n",
|
405 |
+
"champions_name, champions_role = [], []\n",
|
406 |
+
"for i, value in enumerate(champions):\n",
|
407 |
+
" if i % 3 == 0:\n",
|
408 |
+
" champions_name.append(value)\n",
|
409 |
+
" if i % 3 == 1:\n",
|
410 |
+
" champions_role.append(value)"
|
411 |
+
],
|
412 |
+
"metadata": {
|
413 |
+
"id": "eNdAqgrmG7ix"
|
414 |
+
},
|
415 |
+
"execution_count": 7,
|
416 |
+
"outputs": []
|
417 |
+
},
|
418 |
+
{
|
419 |
+
"cell_type": "code",
|
420 |
+
"source": [
|
421 |
+
"champions_name"
|
422 |
+
],
|
423 |
+
"metadata": {
|
424 |
+
"colab": {
|
425 |
+
"base_uri": "https://localhost:8080/"
|
426 |
+
},
|
427 |
+
"id": "Ii1Pn1nVF4dI",
|
428 |
+
"outputId": "7784479c-1c89-45b0-b90a-9d9050971cb3"
|
429 |
+
},
|
430 |
+
"execution_count": 9,
|
431 |
+
"outputs": [
|
432 |
+
{
|
433 |
+
"output_type": "execute_result",
|
434 |
+
"data": {
|
435 |
+
"text/plain": [
|
436 |
+
"['Aatrox',\n",
|
437 |
+
" 'Ahri',\n",
|
438 |
+
" 'Akali',\n",
|
439 |
+
" 'Akshan',\n",
|
440 |
+
" 'Alistar',\n",
|
441 |
+
" 'Ambessa',\n",
|
442 |
+
" 'Amumu',\n",
|
443 |
+
" 'Anivia',\n",
|
444 |
+
" 'Annie',\n",
|
445 |
+
" 'Aphelios',\n",
|
446 |
+
" 'Ashe',\n",
|
447 |
+
" 'Aurelion Sol',\n",
|
448 |
+
" 'Aurora',\n",
|
449 |
+
" 'Azir',\n",
|
450 |
+
" 'Bard',\n",
|
451 |
+
" \"Bel'Veth\",\n",
|
452 |
+
" 'Blitzcrank',\n",
|
453 |
+
" 'Brand',\n",
|
454 |
+
" 'Braum',\n",
|
455 |
+
" 'Briar',\n",
|
456 |
+
" 'Caitlyn',\n",
|
457 |
+
" 'Camille',\n",
|
458 |
+
" 'Cassiopeia',\n",
|
459 |
+
" \"Cho'Gath\",\n",
|
460 |
+
" 'Corki',\n",
|
461 |
+
" 'Darius',\n",
|
462 |
+
" 'Diana',\n",
|
463 |
+
" 'Dr. Mundo',\n",
|
464 |
+
" 'Draven',\n",
|
465 |
+
" 'Ekko',\n",
|
466 |
+
" 'Elise',\n",
|
467 |
+
" 'Evelynn',\n",
|
468 |
+
" 'Ezreal',\n",
|
469 |
+
" 'Fiddlesticks',\n",
|
470 |
+
" 'Fiora',\n",
|
471 |
+
" 'Fizz',\n",
|
472 |
+
" 'Galio',\n",
|
473 |
+
" 'Gangplank',\n",
|
474 |
+
" 'Garen',\n",
|
475 |
+
" 'Gnar',\n",
|
476 |
+
" 'Gragas',\n",
|
477 |
+
" 'Graves',\n",
|
478 |
+
" 'Gwen',\n",
|
479 |
+
" 'Hecarim',\n",
|
480 |
+
" 'Heimerdinger',\n",
|
481 |
+
" 'Hwei',\n",
|
482 |
+
" 'Illaoi',\n",
|
483 |
+
" 'Irelia',\n",
|
484 |
+
" 'Ivern',\n",
|
485 |
+
" 'Janna',\n",
|
486 |
+
" 'Jarvan IV',\n",
|
487 |
+
" 'Jax',\n",
|
488 |
+
" 'Jayce',\n",
|
489 |
+
" 'Jhin',\n",
|
490 |
+
" 'Jinx',\n",
|
491 |
+
" \"K'Sante\",\n",
|
492 |
+
" \"Kai'Sa\",\n",
|
493 |
+
" 'Kalista',\n",
|
494 |
+
" 'Karma',\n",
|
495 |
+
" 'Karthus',\n",
|
496 |
+
" 'Kassadin',\n",
|
497 |
+
" 'Katarina',\n",
|
498 |
+
" 'Kayle',\n",
|
499 |
+
" 'Kayn',\n",
|
500 |
+
" 'Kennen',\n",
|
501 |
+
" \"Kha'Zix\",\n",
|
502 |
+
" 'Kindred',\n",
|
503 |
+
" 'Kled',\n",
|
504 |
+
" \"Kog'Maw\",\n",
|
505 |
+
" 'LeBlanc',\n",
|
506 |
+
" 'Lee Sin',\n",
|
507 |
+
" 'Leona',\n",
|
508 |
+
" 'Lillia',\n",
|
509 |
+
" 'Lissandra',\n",
|
510 |
+
" 'Lucian',\n",
|
511 |
+
" 'Lulu',\n",
|
512 |
+
" 'Lux',\n",
|
513 |
+
" 'Malphite',\n",
|
514 |
+
" 'Malzahar',\n",
|
515 |
+
" 'Maokai',\n",
|
516 |
+
" 'Master Yi',\n",
|
517 |
+
" 'Milio',\n",
|
518 |
+
" 'Miss Fortune',\n",
|
519 |
+
" 'Mordekaiser',\n",
|
520 |
+
" 'Morgana',\n",
|
521 |
+
" 'Naafiri',\n",
|
522 |
+
" 'Nami',\n",
|
523 |
+
" 'Nasus',\n",
|
524 |
+
" 'Nautilus',\n",
|
525 |
+
" 'Neeko',\n",
|
526 |
+
" 'Nidalee',\n",
|
527 |
+
" 'Nilah',\n",
|
528 |
+
" 'Nocturne',\n",
|
529 |
+
" 'Nunu & Willump',\n",
|
530 |
+
" 'Olaf',\n",
|
531 |
+
" 'Orianna',\n",
|
532 |
+
" 'Ornn',\n",
|
533 |
+
" 'Pantheon',\n",
|
534 |
+
" 'Poppy',\n",
|
535 |
+
" 'Pyke',\n",
|
536 |
+
" 'Qiyana',\n",
|
537 |
+
" 'Quinn',\n",
|
538 |
+
" 'Rakan',\n",
|
539 |
+
" 'Rammus',\n",
|
540 |
+
" \"Rek'Sai\",\n",
|
541 |
+
" 'Rell',\n",
|
542 |
+
" 'Renata Glasc',\n",
|
543 |
+
" 'Renekton',\n",
|
544 |
+
" 'Rengar',\n",
|
545 |
+
" 'Riven',\n",
|
546 |
+
" 'Rumble',\n",
|
547 |
+
" 'Ryze',\n",
|
548 |
+
" 'Samira',\n",
|
549 |
+
" 'Sejuani',\n",
|
550 |
+
" 'Senna',\n",
|
551 |
+
" 'Seraphine',\n",
|
552 |
+
" 'Sett',\n",
|
553 |
+
" 'Shaco',\n",
|
554 |
+
" 'Shen',\n",
|
555 |
+
" 'Shyvana',\n",
|
556 |
+
" 'Singed',\n",
|
557 |
+
" 'Sion',\n",
|
558 |
+
" 'Sivir',\n",
|
559 |
+
" 'Skarner',\n",
|
560 |
+
" 'Smolder',\n",
|
561 |
+
" 'Sona',\n",
|
562 |
+
" 'Soraka',\n",
|
563 |
+
" 'Swain',\n",
|
564 |
+
" 'Sylas',\n",
|
565 |
+
" 'Syndra',\n",
|
566 |
+
" 'Tahm Kench',\n",
|
567 |
+
" 'Taliyah',\n",
|
568 |
+
" 'Talon',\n",
|
569 |
+
" 'Taric',\n",
|
570 |
+
" 'Teemo',\n",
|
571 |
+
" 'Thresh',\n",
|
572 |
+
" 'Tristana',\n",
|
573 |
+
" 'Trundle',\n",
|
574 |
+
" 'Tryndamere',\n",
|
575 |
+
" 'Twisted Fate',\n",
|
576 |
+
" 'Twitch',\n",
|
577 |
+
" 'Udyr',\n",
|
578 |
+
" 'Urgot',\n",
|
579 |
+
" 'Varus',\n",
|
580 |
+
" 'Vayne',\n",
|
581 |
+
" 'Veigar',\n",
|
582 |
+
" \"Vel'Koz\",\n",
|
583 |
+
" 'Vex',\n",
|
584 |
+
" 'Vi',\n",
|
585 |
+
" 'Viego',\n",
|
586 |
+
" 'Viktor',\n",
|
587 |
+
" 'Vladimir',\n",
|
588 |
+
" 'Volibear',\n",
|
589 |
+
" 'Warwick',\n",
|
590 |
+
" 'Wukong',\n",
|
591 |
+
" 'Xayah',\n",
|
592 |
+
" 'Xerath',\n",
|
593 |
+
" 'Xin Zhao',\n",
|
594 |
+
" 'Yasuo',\n",
|
595 |
+
" 'Yone',\n",
|
596 |
+
" 'Yorick',\n",
|
597 |
+
" 'Yuumi',\n",
|
598 |
+
" 'Zac',\n",
|
599 |
+
" 'Zed',\n",
|
600 |
+
" 'Zeri',\n",
|
601 |
+
" 'Ziggs',\n",
|
602 |
+
" 'Zilean',\n",
|
603 |
+
" 'Zoe',\n",
|
604 |
+
" 'Zyra']"
|
605 |
+
]
|
606 |
+
},
|
607 |
+
"metadata": {},
|
608 |
+
"execution_count": 9
|
609 |
+
}
|
610 |
+
]
|
611 |
+
},
|
612 |
+
{
|
613 |
+
"cell_type": "code",
|
614 |
+
"source": [
|
615 |
+
"'Dr. Mundo'.replace(\". \", \"\")"
|
616 |
+
],
|
617 |
+
"metadata": {
|
618 |
+
"colab": {
|
619 |
+
"base_uri": "https://localhost:8080/",
|
620 |
+
"height": 35
|
621 |
+
},
|
622 |
+
"id": "6ijPGMAJGJOB",
|
623 |
+
"outputId": "dd0fa11f-e003-4d5c-ebef-72311c535025"
|
624 |
+
},
|
625 |
+
"execution_count": 10,
|
626 |
+
"outputs": [
|
627 |
+
{
|
628 |
+
"output_type": "execute_result",
|
629 |
+
"data": {
|
630 |
+
"text/plain": [
|
631 |
+
"'DrMundo'"
|
632 |
+
],
|
633 |
+
"application/vnd.google.colaboratory.intrinsic+json": {
|
634 |
+
"type": "string"
|
635 |
+
}
|
636 |
+
},
|
637 |
+
"metadata": {},
|
638 |
+
"execution_count": 10
|
639 |
+
}
|
640 |
+
]
|
641 |
+
},
|
642 |
+
{
|
643 |
+
"cell_type": "markdown",
|
644 |
+
"source": [
|
645 |
+
"## Step 2: Extract its lore"
|
646 |
+
],
|
647 |
+
"metadata": {
|
648 |
+
"id": "_ZKEjxbFG-o9"
|
649 |
+
}
|
650 |
+
},
|
651 |
+
{
|
652 |
+
"cell_type": "code",
|
653 |
+
"source": [
|
654 |
+
"import requests\n",
|
655 |
+
"from bs4 import BeautifulSoup\n",
|
656 |
+
"champions_data = []\n",
|
657 |
+
"import pandas as pd\n",
|
658 |
+
"from selenium import webdriver\n",
|
659 |
+
"from selenium.webdriver.chrome.service import Service\n",
|
660 |
+
"from webdriver_manager.chrome import ChromeDriverManager\n",
|
661 |
+
"from selenium.webdriver.common.by import By\n",
|
662 |
+
"from selenium.webdriver.chrome.options import Options\n",
|
663 |
+
"from selenium.webdriver.support.ui import WebDriverWait\n",
|
664 |
+
"from selenium.webdriver.support import expected_conditions as EC\n",
|
665 |
+
"import time\n",
|
666 |
+
"\n",
|
667 |
+
"# List of champions\n",
|
668 |
+
"champions = champions_name\n",
|
669 |
+
"# Configure options for headless Chrome\n",
|
670 |
+
"chrome_options = Options()\n",
|
671 |
+
"chrome_options.add_argument(\"--headless\")\n",
|
672 |
+
"chrome_options.add_argument(\"--no-sandbox\")\n",
|
673 |
+
"chrome_options.add_argument(\"--disable-dev-shm-usage\")\n",
|
674 |
+
"service = Service(ChromeDriverManager().install())\n",
|
675 |
+
"\n",
|
676 |
+
"# Function to scrape champion data and store it\n",
|
677 |
+
"def scrape_champion_data(champion_name):\n",
|
678 |
+
" # Assuming champion_name is a string\n",
|
679 |
+
" champion_name = champion_name.replace(\" \", \"\") # Remove spaces\n",
|
680 |
+
" champion_name = champion_name.replace(\"'\", \"\") # Remove apostrophes\n",
|
681 |
+
" champion_name = champion_name.replace(\".\", \"\") # Remove dot\n",
|
682 |
+
" if champion_name == \"nunu&willump\":\n",
|
683 |
+
" champion_name = \"nunu\"\n",
|
684 |
+
" url = f\"https://universe.leagueoflegends.com/en_GB/story/champion/{champion_name}/\"\n",
|
685 |
+
" print(url)\n",
|
686 |
+
" # Send a GET request to fetch the page\n",
|
687 |
+
" response = requests.get(url)\n",
|
688 |
+
" response.encoding = 'utf-8' # Set the encoding to UTF-8, or use response.apparent_encoding\n",
|
689 |
+
" # Parse the HTML content using BeautifulSoup\n",
|
690 |
+
" soup = BeautifulSoup(response.text, 'html.parser')\n",
|
691 |
+
"\n",
|
692 |
+
" # Find the <meta> tag with the biography content\n",
|
693 |
+
" meta_tag = soup.find('meta', attrs={'name': 'description'})\n",
|
694 |
+
" if meta_tag and champion_name != \"ambessa\":\n",
|
695 |
+
" biography_text = meta_tag.get('content')\n",
|
696 |
+
" champions_data.append({\n",
|
697 |
+
" \"Champion\": champion_name,\n",
|
698 |
+
" \"Text\": biography_text\n",
|
699 |
+
" })\n",
|
700 |
+
" else:\n",
|
701 |
+
" try:\n",
|
702 |
+
"\n",
|
703 |
+
" browser = webdriver.Chrome(service=service, options=chrome_options)\n",
|
704 |
+
"\n",
|
705 |
+
" # Construct URL for the champion\n",
|
706 |
+
" url = f\"https://universe.leagueoflegends.com/en_GB/story/champion/{champion_name}/\"\n",
|
707 |
+
"\n",
|
708 |
+
" # Open the page\n",
|
709 |
+
" browser.get(url)\n",
|
710 |
+
"\n",
|
711 |
+
" # Wait for the page to load and the desired element to be visible\n",
|
712 |
+
" WebDriverWait(browser, 10).until(\n",
|
713 |
+
" EC.presence_of_element_located((By.CLASS_NAME, \"root_3nvd.dark_1RHo\"))\n",
|
714 |
+
" )\n",
|
715 |
+
"\n",
|
716 |
+
" # Scroll down to ensure content is loaded\n",
|
717 |
+
" browser.execute_script(\"window.scrollTo(0, document.body.scrollHeight / 2);\")\n",
|
718 |
+
"\n",
|
719 |
+
" # Extract the text content\n",
|
720 |
+
" element = browser.find_element(By.CLASS_NAME, \"root_3nvd.dark_1RHo\")\n",
|
721 |
+
" text_content = element.text\n",
|
722 |
+
"\n",
|
723 |
+
" # Append the data to the list\n",
|
724 |
+
" champions_data.append({\n",
|
725 |
+
" \"Champion\": champion_name,\n",
|
726 |
+
" \"Text\": text_content\n",
|
727 |
+
" })\n",
|
728 |
+
" browser.quit()\n",
|
729 |
+
" except:\n",
|
730 |
+
" champions_data.append({\n",
|
731 |
+
" \"Champion\": champion_name,\n",
|
732 |
+
" \"Text\": f\"Biography content not found for {champion_name}.\"\n",
|
733 |
+
" })\n",
|
734 |
+
" print(\"Biography content not found.\")\n",
|
735 |
+
"# Loop through the champions and scrape data\n",
|
736 |
+
"for champion in champions:\n",
|
737 |
+
" scrape_champion_data(champion.lower())\n"
|
738 |
+
],
|
739 |
+
"metadata": {
|
740 |
+
"id": "wlz85RVREnkp",
|
741 |
+
"colab": {
|
742 |
+
"base_uri": "https://localhost:8080/"
|
743 |
+
},
|
744 |
+
"outputId": "d60072ac-33cd-4dbf-d82e-f36cad4ab33d"
|
745 |
+
},
|
746 |
+
"execution_count": 13,
|
747 |
+
"outputs": [
|
748 |
+
{
|
749 |
+
"output_type": "stream",
|
750 |
+
"name": "stdout",
|
751 |
+
"text": [
|
752 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/aatrox/\n",
|
753 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ahri/\n",
|
754 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/akali/\n",
|
755 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/akshan/\n",
|
756 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/alistar/\n",
|
757 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ambessa/\n",
|
758 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/amumu/\n",
|
759 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/anivia/\n",
|
760 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/annie/\n",
|
761 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/aphelios/\n",
|
762 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ashe/\n",
|
763 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/aurelionsol/\n",
|
764 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/aurora/\n",
|
765 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/azir/\n",
|
766 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/bard/\n",
|
767 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/belveth/\n",
|
768 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/blitzcrank/\n",
|
769 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/brand/\n",
|
770 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/braum/\n",
|
771 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/briar/\n",
|
772 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/caitlyn/\n",
|
773 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/camille/\n",
|
774 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/cassiopeia/\n",
|
775 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/chogath/\n",
|
776 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/corki/\n",
|
777 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/darius/\n",
|
778 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/diana/\n",
|
779 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/drmundo/\n",
|
780 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/draven/\n",
|
781 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ekko/\n",
|
782 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/elise/\n",
|
783 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/evelynn/\n",
|
784 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ezreal/\n",
|
785 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/fiddlesticks/\n",
|
786 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/fiora/\n",
|
787 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/fizz/\n",
|
788 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/galio/\n",
|
789 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/gangplank/\n",
|
790 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/garen/\n",
|
791 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/gnar/\n",
|
792 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/gragas/\n",
|
793 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/graves/\n",
|
794 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/gwen/\n",
|
795 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/hecarim/\n",
|
796 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/heimerdinger/\n",
|
797 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/hwei/\n",
|
798 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/illaoi/\n",
|
799 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/irelia/\n",
|
800 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ivern/\n",
|
801 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/janna/\n",
|
802 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/jarvaniv/\n",
|
803 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/jax/\n",
|
804 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/jayce/\n",
|
805 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/jhin/\n",
|
806 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/jinx/\n",
|
807 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ksante/\n",
|
808 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kaisa/\n",
|
809 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kalista/\n",
|
810 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/karma/\n",
|
811 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/karthus/\n",
|
812 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kassadin/\n",
|
813 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/katarina/\n",
|
814 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kayle/\n",
|
815 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kayn/\n",
|
816 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kennen/\n",
|
817 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/khazix/\n",
|
818 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kindred/\n",
|
819 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kled/\n",
|
820 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/kogmaw/\n",
|
821 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/leblanc/\n",
|
822 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/leesin/\n",
|
823 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/leona/\n",
|
824 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/lillia/\n",
|
825 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/lissandra/\n",
|
826 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/lucian/\n",
|
827 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/lulu/\n",
|
828 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/lux/\n",
|
829 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/malphite/\n",
|
830 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/malzahar/\n",
|
831 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/maokai/\n",
|
832 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/masteryi/\n",
|
833 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/milio/\n",
|
834 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/missfortune/\n",
|
835 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/mordekaiser/\n",
|
836 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/morgana/\n",
|
837 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/naafiri/\n",
|
838 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nami/\n",
|
839 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nasus/\n",
|
840 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nautilus/\n",
|
841 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/neeko/\n",
|
842 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nidalee/\n",
|
843 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nilah/\n",
|
844 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nocturne/\n",
|
845 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/nunu/\n",
|
846 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/olaf/\n",
|
847 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/orianna/\n",
|
848 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ornn/\n",
|
849 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/pantheon/\n",
|
850 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/poppy/\n",
|
851 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/pyke/\n",
|
852 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/qiyana/\n",
|
853 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/quinn/\n",
|
854 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/rakan/\n",
|
855 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/rammus/\n",
|
856 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/reksai/\n",
|
857 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/rell/\n",
|
858 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/renataglasc/\n",
|
859 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/renekton/\n",
|
860 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/rengar/\n",
|
861 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/riven/\n",
|
862 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/rumble/\n",
|
863 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ryze/\n",
|
864 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/samira/\n",
|
865 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sejuani/\n",
|
866 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/senna/\n",
|
867 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/seraphine/\n",
|
868 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sett/\n",
|
869 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/shaco/\n",
|
870 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/shen/\n",
|
871 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/shyvana/\n",
|
872 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/singed/\n",
|
873 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sion/\n",
|
874 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sivir/\n",
|
875 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/skarner/\n",
|
876 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/smolder/\n",
|
877 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sona/\n",
|
878 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/soraka/\n",
|
879 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/swain/\n",
|
880 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/sylas/\n",
|
881 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/syndra/\n",
|
882 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/tahmkench/\n",
|
883 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/taliyah/\n",
|
884 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/talon/\n",
|
885 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/taric/\n",
|
886 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/teemo/\n",
|
887 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/thresh/\n",
|
888 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/tristana/\n",
|
889 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/trundle/\n",
|
890 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/tryndamere/\n",
|
891 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/twistedfate/\n",
|
892 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/twitch/\n",
|
893 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/udyr/\n",
|
894 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/urgot/\n",
|
895 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/varus/\n",
|
896 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/vayne/\n",
|
897 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/veigar/\n",
|
898 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/velkoz/\n",
|
899 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/vex/\n",
|
900 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/vi/\n",
|
901 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/viego/\n",
|
902 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/viktor/\n",
|
903 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/vladimir/\n",
|
904 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/volibear/\n",
|
905 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/warwick/\n",
|
906 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/wukong/\n",
|
907 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/xayah/\n",
|
908 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/xerath/\n",
|
909 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/xinzhao/\n",
|
910 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/yasuo/\n",
|
911 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/yone/\n",
|
912 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/yorick/\n",
|
913 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/yuumi/\n",
|
914 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zac/\n",
|
915 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zed/\n",
|
916 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zeri/\n",
|
917 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/ziggs/\n",
|
918 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zilean/\n",
|
919 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zoe/\n",
|
920 |
+
"https://universe.leagueoflegends.com/en_GB/story/champion/zyra/\n"
|
921 |
+
]
|
922 |
+
}
|
923 |
+
]
|
924 |
+
},
|
925 |
+
{
|
926 |
+
"cell_type": "markdown",
|
927 |
+
"source": [
|
928 |
+
"## Step 3: Transform into dataframe"
|
929 |
+
],
|
930 |
+
"metadata": {
|
931 |
+
"id": "ESQDGQl2HDvW"
|
932 |
+
}
|
933 |
+
},
|
934 |
+
{
|
935 |
+
"cell_type": "code",
|
936 |
+
"source": [
|
937 |
+
"# Create a DataFrame from the list of champions data\n",
|
938 |
+
"df1 = pd.DataFrame(champions_data)\n",
|
939 |
+
"\n",
|
940 |
+
"# Rename columns\n",
|
941 |
+
"df1.columns = ['Champion', 'Story']\n",
|
942 |
+
"\n",
|
943 |
+
"# Add champions role\n",
|
944 |
+
"df1['Role'] = champions_role\n",
|
945 |
+
"\n",
|
946 |
+
"# Undo the champions name changed for url\n",
|
947 |
+
"df1['Champion'] = champions_name\n",
|
948 |
+
"\n",
|
949 |
+
"# Save it to a CSV file if you want\n",
|
950 |
+
"df1.to_csv(\"champions_data.csv\", index=False)"
|
951 |
+
],
|
952 |
+
"metadata": {
|
953 |
+
"id": "AHCHv4EJHGyg"
|
954 |
+
},
|
955 |
+
"execution_count": 16,
|
956 |
+
"outputs": []
|
957 |
+
},
|
958 |
+
{
|
959 |
+
"cell_type": "code",
|
960 |
+
"source": [
|
961 |
+
"df1"
|
962 |
+
],
|
963 |
+
"metadata": {
|
964 |
+
"colab": {
|
965 |
+
"base_uri": "https://localhost:8080/",
|
966 |
+
"height": 423
|
967 |
+
},
|
968 |
+
"id": "79wwP4P5HNPf",
|
969 |
+
"outputId": "39185e1f-633b-42ad-8d11-1681edd13c66"
|
970 |
+
},
|
971 |
+
"execution_count": 15,
|
972 |
+
"outputs": [
|
973 |
+
{
|
974 |
+
"output_type": "execute_result",
|
975 |
+
"data": {
|
976 |
+
"text/plain": [
|
977 |
+
" Champion Story \\\n",
|
978 |
+
"0 Aatrox Whether mistaken for a demon or god, many tale... \n",
|
979 |
+
"1 Ahri For most of her life, Ahri's origins were a my... \n",
|
980 |
+
"2 Akali Ionia has always been a land of wild magic, it... \n",
|
981 |
+
"3 Akshan Dashing through the shadows of eastern Shurima... \n",
|
982 |
+
"4 Alistar Many civilizations have resisted Noxus, but no... \n",
|
983 |
+
".. ... ... \n",
|
984 |
+
"164 Zeri Raised in a large working-class family, Zeri g... \n",
|
985 |
+
"165 Ziggs Ziggs was born with a talent for tinkering, bu... \n",
|
986 |
+
"166 Zilean Icathia, most desolate and cursed of lands, wa... \n",
|
987 |
+
"167 Zoe As befits her Targonian Aspect’s nature, Zoe d... \n",
|
988 |
+
"168 Zyra Zyra’s memory is long, and runs as deep as the... \n",
|
989 |
+
"\n",
|
990 |
+
" Role \n",
|
991 |
+
"0 Juggernaut \n",
|
992 |
+
"1 Burst \n",
|
993 |
+
"2 Assassin \n",
|
994 |
+
"3 Marksman,Assassin \n",
|
995 |
+
"4 Vanguard \n",
|
996 |
+
".. ... \n",
|
997 |
+
"164 Marksman \n",
|
998 |
+
"165 Artillery \n",
|
999 |
+
"166 Specialist \n",
|
1000 |
+
"167 Burst \n",
|
1001 |
+
"168 Catcher \n",
|
1002 |
+
"\n",
|
1003 |
+
"[169 rows x 3 columns]"
|
1004 |
+
],
|
1005 |
+
"text/html": [
|
1006 |
+
"\n",
|
1007 |
+
" <div id=\"df-b7fa5f67-2e1f-4a6f-b82c-4107c1aec563\" class=\"colab-df-container\">\n",
|
1008 |
+
" <div>\n",
|
1009 |
+
"<style scoped>\n",
|
1010 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
1011 |
+
" vertical-align: middle;\n",
|
1012 |
+
" }\n",
|
1013 |
+
"\n",
|
1014 |
+
" .dataframe tbody tr th {\n",
|
1015 |
+
" vertical-align: top;\n",
|
1016 |
+
" }\n",
|
1017 |
+
"\n",
|
1018 |
+
" .dataframe thead th {\n",
|
1019 |
+
" text-align: right;\n",
|
1020 |
+
" }\n",
|
1021 |
+
"</style>\n",
|
1022 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
1023 |
+
" <thead>\n",
|
1024 |
+
" <tr style=\"text-align: right;\">\n",
|
1025 |
+
" <th></th>\n",
|
1026 |
+
" <th>Champion</th>\n",
|
1027 |
+
" <th>Story</th>\n",
|
1028 |
+
" <th>Role</th>\n",
|
1029 |
+
" </tr>\n",
|
1030 |
+
" </thead>\n",
|
1031 |
+
" <tbody>\n",
|
1032 |
+
" <tr>\n",
|
1033 |
+
" <th>0</th>\n",
|
1034 |
+
" <td>Aatrox</td>\n",
|
1035 |
+
" <td>Whether mistaken for a demon or god, many tale...</td>\n",
|
1036 |
+
" <td>Juggernaut</td>\n",
|
1037 |
+
" </tr>\n",
|
1038 |
+
" <tr>\n",
|
1039 |
+
" <th>1</th>\n",
|
1040 |
+
" <td>Ahri</td>\n",
|
1041 |
+
" <td>For most of her life, Ahri's origins were a my...</td>\n",
|
1042 |
+
" <td>Burst</td>\n",
|
1043 |
+
" </tr>\n",
|
1044 |
+
" <tr>\n",
|
1045 |
+
" <th>2</th>\n",
|
1046 |
+
" <td>Akali</td>\n",
|
1047 |
+
" <td>Ionia has always been a land of wild magic, it...</td>\n",
|
1048 |
+
" <td>Assassin</td>\n",
|
1049 |
+
" </tr>\n",
|
1050 |
+
" <tr>\n",
|
1051 |
+
" <th>3</th>\n",
|
1052 |
+
" <td>Akshan</td>\n",
|
1053 |
+
" <td>Dashing through the shadows of eastern Shurima...</td>\n",
|
1054 |
+
" <td>Marksman,Assassin</td>\n",
|
1055 |
+
" </tr>\n",
|
1056 |
+
" <tr>\n",
|
1057 |
+
" <th>4</th>\n",
|
1058 |
+
" <td>Alistar</td>\n",
|
1059 |
+
" <td>Many civilizations have resisted Noxus, but no...</td>\n",
|
1060 |
+
" <td>Vanguard</td>\n",
|
1061 |
+
" </tr>\n",
|
1062 |
+
" <tr>\n",
|
1063 |
+
" <th>...</th>\n",
|
1064 |
+
" <td>...</td>\n",
|
1065 |
+
" <td>...</td>\n",
|
1066 |
+
" <td>...</td>\n",
|
1067 |
+
" </tr>\n",
|
1068 |
+
" <tr>\n",
|
1069 |
+
" <th>164</th>\n",
|
1070 |
+
" <td>Zeri</td>\n",
|
1071 |
+
" <td>Raised in a large working-class family, Zeri g...</td>\n",
|
1072 |
+
" <td>Marksman</td>\n",
|
1073 |
+
" </tr>\n",
|
1074 |
+
" <tr>\n",
|
1075 |
+
" <th>165</th>\n",
|
1076 |
+
" <td>Ziggs</td>\n",
|
1077 |
+
" <td>Ziggs was born with a talent for tinkering, bu...</td>\n",
|
1078 |
+
" <td>Artillery</td>\n",
|
1079 |
+
" </tr>\n",
|
1080 |
+
" <tr>\n",
|
1081 |
+
" <th>166</th>\n",
|
1082 |
+
" <td>Zilean</td>\n",
|
1083 |
+
" <td>Icathia, most desolate and cursed of lands, wa...</td>\n",
|
1084 |
+
" <td>Specialist</td>\n",
|
1085 |
+
" </tr>\n",
|
1086 |
+
" <tr>\n",
|
1087 |
+
" <th>167</th>\n",
|
1088 |
+
" <td>Zoe</td>\n",
|
1089 |
+
" <td>As befits her Targonian Aspect’s nature, Zoe d...</td>\n",
|
1090 |
+
" <td>Burst</td>\n",
|
1091 |
+
" </tr>\n",
|
1092 |
+
" <tr>\n",
|
1093 |
+
" <th>168</th>\n",
|
1094 |
+
" <td>Zyra</td>\n",
|
1095 |
+
" <td>Zyra’s memory is long, and runs as deep as the...</td>\n",
|
1096 |
+
" <td>Catcher</td>\n",
|
1097 |
+
" </tr>\n",
|
1098 |
+
" </tbody>\n",
|
1099 |
+
"</table>\n",
|
1100 |
+
"<p>169 rows × 3 columns</p>\n",
|
1101 |
+
"</div>\n",
|
1102 |
+
" <div class=\"colab-df-buttons\">\n",
|
1103 |
+
"\n",
|
1104 |
+
" <div class=\"colab-df-container\">\n",
|
1105 |
+
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-b7fa5f67-2e1f-4a6f-b82c-4107c1aec563')\"\n",
|
1106 |
+
" title=\"Convert this dataframe to an interactive table.\"\n",
|
1107 |
+
" style=\"display:none;\">\n",
|
1108 |
+
"\n",
|
1109 |
+
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
1110 |
+
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
1111 |
+
" </svg>\n",
|
1112 |
+
" </button>\n",
|
1113 |
+
"\n",
|
1114 |
+
" <style>\n",
|
1115 |
+
" .colab-df-container {\n",
|
1116 |
+
" display:flex;\n",
|
1117 |
+
" gap: 12px;\n",
|
1118 |
+
" }\n",
|
1119 |
+
"\n",
|
1120 |
+
" .colab-df-convert {\n",
|
1121 |
+
" background-color: #E8F0FE;\n",
|
1122 |
+
" border: none;\n",
|
1123 |
+
" border-radius: 50%;\n",
|
1124 |
+
" cursor: pointer;\n",
|
1125 |
+
" display: none;\n",
|
1126 |
+
" fill: #1967D2;\n",
|
1127 |
+
" height: 32px;\n",
|
1128 |
+
" padding: 0 0 0 0;\n",
|
1129 |
+
" width: 32px;\n",
|
1130 |
+
" }\n",
|
1131 |
+
"\n",
|
1132 |
+
" .colab-df-convert:hover {\n",
|
1133 |
+
" background-color: #E2EBFA;\n",
|
1134 |
+
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
1135 |
+
" fill: #174EA6;\n",
|
1136 |
+
" }\n",
|
1137 |
+
"\n",
|
1138 |
+
" .colab-df-buttons div {\n",
|
1139 |
+
" margin-bottom: 4px;\n",
|
1140 |
+
" }\n",
|
1141 |
+
"\n",
|
1142 |
+
" [theme=dark] .colab-df-convert {\n",
|
1143 |
+
" background-color: #3B4455;\n",
|
1144 |
+
" fill: #D2E3FC;\n",
|
1145 |
+
" }\n",
|
1146 |
+
"\n",
|
1147 |
+
" [theme=dark] .colab-df-convert:hover {\n",
|
1148 |
+
" background-color: #434B5C;\n",
|
1149 |
+
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
1150 |
+
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
1151 |
+
" fill: #FFFFFF;\n",
|
1152 |
+
" }\n",
|
1153 |
+
" </style>\n",
|
1154 |
+
"\n",
|
1155 |
+
" <script>\n",
|
1156 |
+
" const buttonEl =\n",
|
1157 |
+
" document.querySelector('#df-b7fa5f67-2e1f-4a6f-b82c-4107c1aec563 button.colab-df-convert');\n",
|
1158 |
+
" buttonEl.style.display =\n",
|
1159 |
+
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
1160 |
+
"\n",
|
1161 |
+
" async function convertToInteractive(key) {\n",
|
1162 |
+
" const element = document.querySelector('#df-b7fa5f67-2e1f-4a6f-b82c-4107c1aec563');\n",
|
1163 |
+
" const dataTable =\n",
|
1164 |
+
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
1165 |
+
" [key], {});\n",
|
1166 |
+
" if (!dataTable) return;\n",
|
1167 |
+
"\n",
|
1168 |
+
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
1169 |
+
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
1170 |
+
" + ' to learn more about interactive tables.';\n",
|
1171 |
+
" element.innerHTML = '';\n",
|
1172 |
+
" dataTable['output_type'] = 'display_data';\n",
|
1173 |
+
" await google.colab.output.renderOutput(dataTable, element);\n",
|
1174 |
+
" const docLink = document.createElement('div');\n",
|
1175 |
+
" docLink.innerHTML = docLinkHtml;\n",
|
1176 |
+
" element.appendChild(docLink);\n",
|
1177 |
+
" }\n",
|
1178 |
+
" </script>\n",
|
1179 |
+
" </div>\n",
|
1180 |
+
"\n",
|
1181 |
+
"\n",
|
1182 |
+
"<div id=\"df-f283d2bc-ac75-4dbd-b1ce-d9f66f3109a5\">\n",
|
1183 |
+
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-f283d2bc-ac75-4dbd-b1ce-d9f66f3109a5')\"\n",
|
1184 |
+
" title=\"Suggest charts\"\n",
|
1185 |
+
" style=\"display:none;\">\n",
|
1186 |
+
"\n",
|
1187 |
+
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
1188 |
+
" width=\"24px\">\n",
|
1189 |
+
" <g>\n",
|
1190 |
+
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
|
1191 |
+
" </g>\n",
|
1192 |
+
"</svg>\n",
|
1193 |
+
" </button>\n",
|
1194 |
+
"\n",
|
1195 |
+
"<style>\n",
|
1196 |
+
" .colab-df-quickchart {\n",
|
1197 |
+
" --bg-color: #E8F0FE;\n",
|
1198 |
+
" --fill-color: #1967D2;\n",
|
1199 |
+
" --hover-bg-color: #E2EBFA;\n",
|
1200 |
+
" --hover-fill-color: #174EA6;\n",
|
1201 |
+
" --disabled-fill-color: #AAA;\n",
|
1202 |
+
" --disabled-bg-color: #DDD;\n",
|
1203 |
+
" }\n",
|
1204 |
+
"\n",
|
1205 |
+
" [theme=dark] .colab-df-quickchart {\n",
|
1206 |
+
" --bg-color: #3B4455;\n",
|
1207 |
+
" --fill-color: #D2E3FC;\n",
|
1208 |
+
" --hover-bg-color: #434B5C;\n",
|
1209 |
+
" --hover-fill-color: #FFFFFF;\n",
|
1210 |
+
" --disabled-bg-color: #3B4455;\n",
|
1211 |
+
" --disabled-fill-color: #666;\n",
|
1212 |
+
" }\n",
|
1213 |
+
"\n",
|
1214 |
+
" .colab-df-quickchart {\n",
|
1215 |
+
" background-color: var(--bg-color);\n",
|
1216 |
+
" border: none;\n",
|
1217 |
+
" border-radius: 50%;\n",
|
1218 |
+
" cursor: pointer;\n",
|
1219 |
+
" display: none;\n",
|
1220 |
+
" fill: var(--fill-color);\n",
|
1221 |
+
" height: 32px;\n",
|
1222 |
+
" padding: 0;\n",
|
1223 |
+
" width: 32px;\n",
|
1224 |
+
" }\n",
|
1225 |
+
"\n",
|
1226 |
+
" .colab-df-quickchart:hover {\n",
|
1227 |
+
" background-color: var(--hover-bg-color);\n",
|
1228 |
+
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
1229 |
+
" fill: var(--button-hover-fill-color);\n",
|
1230 |
+
" }\n",
|
1231 |
+
"\n",
|
1232 |
+
" .colab-df-quickchart-complete:disabled,\n",
|
1233 |
+
" .colab-df-quickchart-complete:disabled:hover {\n",
|
1234 |
+
" background-color: var(--disabled-bg-color);\n",
|
1235 |
+
" fill: var(--disabled-fill-color);\n",
|
1236 |
+
" box-shadow: none;\n",
|
1237 |
+
" }\n",
|
1238 |
+
"\n",
|
1239 |
+
" .colab-df-spinner {\n",
|
1240 |
+
" border: 2px solid var(--fill-color);\n",
|
1241 |
+
" border-color: transparent;\n",
|
1242 |
+
" border-bottom-color: var(--fill-color);\n",
|
1243 |
+
" animation:\n",
|
1244 |
+
" spin 1s steps(1) infinite;\n",
|
1245 |
+
" }\n",
|
1246 |
+
"\n",
|
1247 |
+
" @keyframes spin {\n",
|
1248 |
+
" 0% {\n",
|
1249 |
+
" border-color: transparent;\n",
|
1250 |
+
" border-bottom-color: var(--fill-color);\n",
|
1251 |
+
" border-left-color: var(--fill-color);\n",
|
1252 |
+
" }\n",
|
1253 |
+
" 20% {\n",
|
1254 |
+
" border-color: transparent;\n",
|
1255 |
+
" border-left-color: var(--fill-color);\n",
|
1256 |
+
" border-top-color: var(--fill-color);\n",
|
1257 |
+
" }\n",
|
1258 |
+
" 30% {\n",
|
1259 |
+
" border-color: transparent;\n",
|
1260 |
+
" border-left-color: var(--fill-color);\n",
|
1261 |
+
" border-top-color: var(--fill-color);\n",
|
1262 |
+
" border-right-color: var(--fill-color);\n",
|
1263 |
+
" }\n",
|
1264 |
+
" 40% {\n",
|
1265 |
+
" border-color: transparent;\n",
|
1266 |
+
" border-right-color: var(--fill-color);\n",
|
1267 |
+
" border-top-color: var(--fill-color);\n",
|
1268 |
+
" }\n",
|
1269 |
+
" 60% {\n",
|
1270 |
+
" border-color: transparent;\n",
|
1271 |
+
" border-right-color: var(--fill-color);\n",
|
1272 |
+
" }\n",
|
1273 |
+
" 80% {\n",
|
1274 |
+
" border-color: transparent;\n",
|
1275 |
+
" border-right-color: var(--fill-color);\n",
|
1276 |
+
" border-bottom-color: var(--fill-color);\n",
|
1277 |
+
" }\n",
|
1278 |
+
" 90% {\n",
|
1279 |
+
" border-color: transparent;\n",
|
1280 |
+
" border-bottom-color: var(--fill-color);\n",
|
1281 |
+
" }\n",
|
1282 |
+
" }\n",
|
1283 |
+
"</style>\n",
|
1284 |
+
"\n",
|
1285 |
+
" <script>\n",
|
1286 |
+
" async function quickchart(key) {\n",
|
1287 |
+
" const quickchartButtonEl =\n",
|
1288 |
+
" document.querySelector('#' + key + ' button');\n",
|
1289 |
+
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
|
1290 |
+
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
|
1291 |
+
" try {\n",
|
1292 |
+
" const charts = await google.colab.kernel.invokeFunction(\n",
|
1293 |
+
" 'suggestCharts', [key], {});\n",
|
1294 |
+
" } catch (error) {\n",
|
1295 |
+
" console.error('Error during call to suggestCharts:', error);\n",
|
1296 |
+
" }\n",
|
1297 |
+
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
|
1298 |
+
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
|
1299 |
+
" }\n",
|
1300 |
+
" (() => {\n",
|
1301 |
+
" let quickchartButtonEl =\n",
|
1302 |
+
" document.querySelector('#df-f283d2bc-ac75-4dbd-b1ce-d9f66f3109a5 button');\n",
|
1303 |
+
" quickchartButtonEl.style.display =\n",
|
1304 |
+
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
1305 |
+
" })();\n",
|
1306 |
+
" </script>\n",
|
1307 |
+
"</div>\n",
|
1308 |
+
"\n",
|
1309 |
+
" <div id=\"id_70fc6d1a-fc2f-4991-9d29-e6842aec3fcb\">\n",
|
1310 |
+
" <style>\n",
|
1311 |
+
" .colab-df-generate {\n",
|
1312 |
+
" background-color: #E8F0FE;\n",
|
1313 |
+
" border: none;\n",
|
1314 |
+
" border-radius: 50%;\n",
|
1315 |
+
" cursor: pointer;\n",
|
1316 |
+
" display: none;\n",
|
1317 |
+
" fill: #1967D2;\n",
|
1318 |
+
" height: 32px;\n",
|
1319 |
+
" padding: 0 0 0 0;\n",
|
1320 |
+
" width: 32px;\n",
|
1321 |
+
" }\n",
|
1322 |
+
"\n",
|
1323 |
+
" .colab-df-generate:hover {\n",
|
1324 |
+
" background-color: #E2EBFA;\n",
|
1325 |
+
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
1326 |
+
" fill: #174EA6;\n",
|
1327 |
+
" }\n",
|
1328 |
+
"\n",
|
1329 |
+
" [theme=dark] .colab-df-generate {\n",
|
1330 |
+
" background-color: #3B4455;\n",
|
1331 |
+
" fill: #D2E3FC;\n",
|
1332 |
+
" }\n",
|
1333 |
+
"\n",
|
1334 |
+
" [theme=dark] .colab-df-generate:hover {\n",
|
1335 |
+
" background-color: #434B5C;\n",
|
1336 |
+
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
1337 |
+
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
1338 |
+
" fill: #FFFFFF;\n",
|
1339 |
+
" }\n",
|
1340 |
+
" </style>\n",
|
1341 |
+
" <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df1')\"\n",
|
1342 |
+
" title=\"Generate code using this dataframe.\"\n",
|
1343 |
+
" style=\"display:none;\">\n",
|
1344 |
+
"\n",
|
1345 |
+
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
1346 |
+
" width=\"24px\">\n",
|
1347 |
+
" <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
|
1348 |
+
" </svg>\n",
|
1349 |
+
" </button>\n",
|
1350 |
+
" <script>\n",
|
1351 |
+
" (() => {\n",
|
1352 |
+
" const buttonEl =\n",
|
1353 |
+
" document.querySelector('#id_70fc6d1a-fc2f-4991-9d29-e6842aec3fcb button.colab-df-generate');\n",
|
1354 |
+
" buttonEl.style.display =\n",
|
1355 |
+
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
1356 |
+
"\n",
|
1357 |
+
" buttonEl.onclick = () => {\n",
|
1358 |
+
" google.colab.notebook.generateWithVariable('df1');\n",
|
1359 |
+
" }\n",
|
1360 |
+
" })();\n",
|
1361 |
+
" </script>\n",
|
1362 |
+
" </div>\n",
|
1363 |
+
"\n",
|
1364 |
+
" </div>\n",
|
1365 |
+
" </div>\n"
|
1366 |
+
],
|
1367 |
+
"application/vnd.google.colaboratory.intrinsic+json": {
|
1368 |
+
"type": "dataframe",
|
1369 |
+
"variable_name": "df1",
|
1370 |
+
"summary": "{\n \"name\": \"df1\",\n \"rows\": 169,\n \"fields\": [\n {\n \"column\": \"Champion\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 169,\n \"samples\": [\n \"Tryndamere\",\n \"Elise\",\n \"Shyvana\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Story\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 169,\n \"samples\": [\n \"Tryndamere came into the world knowing only the harshness of survival, for the frozen steppes where his clan made their home never truly thawed. Though they praised all the Freljord\\u2019s old gods, as well as the Cult of the Three, they prayed most often to a spirit-deity known to ravage the tundra\\u2014a hearty and unkillable tusklord. Since the raw materials required for armor were scarce, the clan instead put its resources toward the forging of great blades, inspired by their god\\u2019s ivory canines.The stamina and dueling prowess of Tryndamere\\u2019s people became legendary. They were able to fend off other raiding tribes, slay the great beasts of the mountains, and repel Noxians encroaching to the south. Tryndamere himself grew to be a brash and formidable warrior, but it wasn\\u2019t until a particularly cruel midwinter night that his strength was truly tested. An unusual storm swept in from the east, bringing with it an icy darkness, and a towering, horned figure silhouetted against the full moon.Some in the clan knelt, believing that their boar-god stood among them. This creature dripped with ancient magic, true enough, but he was not of the Freljord\\u2026 and those that knelt were the first to die.Tryndamere looked on in horror. He could feel unhinged brutality rising in his heart at the sight of the invader\\u2019s cruel, living sword. Whether taken by bloodlust or some other madness, Tryndamere raised his own blade, and let out a defiant roar.The dark figure swatted him aside like an insect.Tryndamere lay surrounded by the dead, in snow soaked almost black with blood. He drew what he thought would be his last breaths as the creature approached and spoke. Tryndamere tried to hold onto the strange, archaic words, but as his life force slipped away, it was the thing\\u2019s laughter that burned itself into the young warrior\\u2019s memory.For Tryndamere did not die that night. He was revived by a rage unlike anything he had ever experienced. He looked to the eastern horizon, intent on avenging not only the destruction of his clan, but the desecration of his own martial pride.However, retribution was not what the steppes offered him. There were survivors, and they would not be long for this world if Tryndamere could not find others to shelter them. There were Noxians to the south, Frostguard to the north, and the dark figure had come from the east. To the west, it was said that some tribes were gathering before the supposed reincarnation of Avarosa\\u2014once, he might have dismissed such fanciful rumors, but now he knew this was his only recourse.Tryndamere and the remnants of his people arrived in the valley as little more than beggars. The young warrior was determined to show his clan\\u2019s worth, and win them the Avarosan leader\\u2019s protection so that he could return to thoughts of revenge. Brandishing his tusked sword, he did what came naturally, and challenged others to duels. Holding the image of the dark figure and its echoing laughter in his mind, Tryndamere quickly bested anyone who stepped forward.His singular fury was deeply unsettling to the Avarosans. The northern warriors, too, noted his rapid healing between bouts\\u2014unlike the Iceborn that walked among them, the more Tryndamere gave in to his rage, the more quickly his body healed. Many suspected he and his clan practiced strange and unnatural magics, and so Tryndamere\\u2019s plan to prove his worth was now endangering the wider acceptance of his people.But not all of the Avarosans had turned against him. Their warmother, Ashe, was looking to strengthen her position with a political marriage\\u2026 to someone who could face down the endless challengers for her hand, and to her rule. Seeing an opportunity in the handsome barbarian, she pledged to take in his clan as Avarosans, if Tryndamere became her first and only bloodsworn.As he spent more time in Ashe\\u2019s company, he began to believe what others had whispered\\u2014that she was indeed the divine reincarnation of Avarosa herself. His rage found temperance in her thoughtful leadership, and a genuine affection grew between them.Even so, serving as Ashe\\u2019s champion, Tryndamere now looks to an uncertain future. The barbarian king can see war brewing all too clearly on the Freljord\\u2019s horizon, yet he still thirsts for his own, personal vengeance, and begins to wonder if his predestined fate might not be at his queen\\u2019s side after all\\u2026\",\n \"The Lady Elise was born centuries ago to House Kythera, one of the oldest bloodlines of Noxus, and swiftly learned the power of beauty to influence the weak.When she came of age, she entertained the courtship of Berholdt, heir to House Zaavan. Their union was opposed by many, since it would strengthen Kythera at Zaavan\\u2019s expense\\u2014but Elise worked hard to beguile her intended husband, and manipulated her detractors to secure a betrothal.Unbeknown to her, this political marriage had been planned for many years by shadowy forces working behind the scenes throughout the empire, with Berholdt Zaavan a mere pawn in a much larger game. Even so, it was an unexpected twist that Elise should dominate him so completely, and while he remained the face of his house, it was clear who was in charge. As time passed, his resentment grew.One evening, over a typically frosty dinner, Berholdt revealed he had poisoned her wine, and demanded Elise withdraw from society and allow him to take up the reins of power. Knowing he would have the antidote about his person, Elise played the role of a remorseful wife, weeping and begging her husband\\u2019s forgiveness. Just as it seemed he might be convinced, she snatched up a knife and plunged it into his heart.Even with the antidote, Elise was bedridden for weeks\\u2026 and it was then that the Pale Woman approached her.The enigmatic mistress of \\u201cthe Black Rose\\u201d spoke of a secret society where hidden knowledge and sorcery were shared among those who could be trusted, and kept from those who could not. In truth, the Pale Woman did not care who controlled each of the noble houses, as long as they were sworn to her. Since Elise had killed the thrall Berholdt, she would have to prove her own value, or a more suitable replacement would be found.Seeing a path to greater power, Elise took to the cabal like few before her. She met often with the most prominent members, trading influence and thwarting her rivals in a complex web of tangled schemes. With the wealth of two houses, there were not many who could oppose her, and she became even more adept at persuading others to do her bidding.Eventually, she learned of an object that held great significance for the Black Rose\\u2014the skull of an ancient warlord known as Sahn-Uzal, rumored to have been hidden long ago in the Shadow Isles. Keen to gain the Pale Woman\\u2019s favor, Elise found a desperate, debt-ridden captain willing to bear her and a handful of devotees to the cursed city of Helia. They came ashore on a beach of ashen sand, and were tormented by spiteful wraiths as they searched in vain for the lost vault.But Elise found something she had not anticipated.A creature of the long-forgotten past had made its home in the lightless depths beneath the city. This bloated, chitinous monster was the spider-god Vilemaw, and it erupted from the darkness to devour the intruders, before sinking its fangs into Elise\\u2019s shoulder. She fell, howling and convulsing as the venom wrought terrible changes upon her body. Her spine rippled with undulant motion, and arachnoid legs pushed out from her flesh.Finally, breathless with the agony of transformation, Elise turned to find her new master looming above her. An unspoken understanding passed between them in that moment, and she scuttled back to the beach, untroubled by the Isles\\u2019 spirits as she weaved in and out of the twisted treeline.Some weeks later, when her ship arrived back at the Noxian capital in the dead of night, Elise had regained her human form\\u2026 though she was the only living thing left aboard.Though no evidence was ever found of the warlord\\u2019s skull, the Pale Woman saw Elise\\u2019s dangerous new gift for what it was\\u2014a means to come and go safely between Noxus and the Shadow Isles. An accord was struck, wherein the Black Rose would provide Elise with endless unwitting sacrifices to offer up to the spider-god, and in return she would recover any artifacts of power she could from those benighted, forbidding shores.Elise once again took up residence in the neglected halls of House Zaavan, carefully cultivating a reputation as a seductive yet unreachable recluse. Few have ever guessed her true nature, yet fanciful rumors abound\\u2014wild tales of her ageless beauty, and a terrifying, voracious creature said to lair in the bowels of her dilapidated, dust-wreathed palace.Though centuries have passed, whenever Elise feels the summons of her god, she returns to the land of the Black Mist with a hapless suitor in tow, or some other easily swayed soul.And none who accompany her ever return.\",\n \"Though they are rare creatures now indeed, there exist a handful of places across Runeterra where the great elemental dragons still nest.Long after the fall of the Shuriman empire, in the chambers beneath a lost volcano, the elder beast known as Yvva guarded her clutch of eggs. Beyond the depredations of rival drakes, dragon eggs were priceless almost beyond a mortal\\u2019s comprehension, and so many were daring or foolish enough to try their luck. Yvva feasted upon the charred remains of a score or more would-be thieves over the years\\u2026 before one succeeded in his attempt.This upstart mage fled the mountains with the large egg hugged close to his chest, the jungle at his heels set ablaze by Yvva\\u2019s fury. Against all odds, he reached the coast and left the dragon to slink back to her lair in defeat. She had lost one egg. She would not lose another.The mage traveled north to Piltover\\u2014but before he could find a buyer, the egg began to hatch. Whether it was the act of removing it from the nest, or the last moon of autumn giving way to winter, something had changed. It was no infant dragon that emerged, but an apparently humanoid baby girl with pale, violet skin, and the mage found he could not bear to abandon her. He raised the child as his own, naming her Shyvana after the dark legend of her brood-mother.It became clear that Shyvana was no mortal. From an early age, she was able to shift her form into something monstrous, akin to the half-dragons of ancient myth. This made living among the common folk of Valoran difficult, to say the least. One thing was clear: Yvva retained some connection with her lost daughter, and it grew stronger over time. When her other offspring finally took flight, Yvva left her empty nest and soared far over the ocean in search of Shyvana.The land was wracked by fierce border wars, but armies and villagers alike scattered at the great dragon\\u2019s approach. Seeking refuge in a ruined farmhouse, Shyvana saw her adopted father engulfed in flames as Yvva swept low overhead\\u2014the young woman dragged him into the nearby forest, but there was nothing more she could do. She buried him in a simple grave beneath a spreading oak, and set off alone.After many weeks in hiding in the wilds, always on the move, Shyvana picked out the faint scent of blood among the trees. She found a wounded warrior, close to death, and knew this was someone she could save.Without a thought for the beast that hunted her, she assumed her half-dragon form and carried the unconscious man far away, to an outpost on the borders of Demacia.There, in the castle at Wrenwall, Shyvana discovered that this warrior was none other than Prince Jarvan\\u2014the king\\u2019s only son, and heir to the throne. Though the stationed soldiers regarded her violet skin and strange manners with some suspicion, she was made welcome. Demacians, it seemed, always looked out for one another, and her time in the town was the most peaceful she had ever known.The peace was not to last. Shyvana sensed darkness on the wind. Yvva was coming.The recovering prince, knowing that he had to marshal Wrenwall\\u2019s garrison, brought the terrified locals inside the stronghold in preparation for the coming battle. Even so, Shyvana prepared to make her escape. Jarvan confronted her, and she admitted that the creature in pursuit of her was of her own blood. She could not allow innocent people to die for that.Jarvan refused to let her go. Shyvana had saved his life, so it was only right that he fight at her side, now. Moved by his offer, she accepted.As Yvva came into view, Demacian archers loosed volleys of arrows to keep her distracted. In retaliation, she bathed the battlements in flame, tearing at the stonework with her powerful talons and sending armored warriors tumbling from the parapet. It was then that Shyvana leapt forth, transforming in mid-air and bellowing a challenge to her brood-mother. In a sight seldom witnessed in Valoran since the Rune Wars, the two dragons clashed, tooth and claw, in the skies over Wrenwall.And finally, bleeding from a dozen wounds, Shyvana grappled Yvva to the ground, and broke the creature\\u2019s neck upon the flagstones.The prince himself honored Shyvana\\u2019s bravery, and promised that she would always have a place at his side, if she would return with him to his father\\u2019s halls. With Yvva\\u2019s skull as proof of their triumph, they set out for the Great City of Demacia together.Shyvana has learned that King Jarvan III\\u2019s realm is somewhat divided\\u2014with the people\\u2019s distrust of mages and magic putting them at odds with the noble ideals upon which it was founded. While she has found a measure of acceptance as one of the prince\\u2019s most trusted guardians, she is left to wonder whether that would still be the case if her true nature were more widely known\\u2026\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Role\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 28,\n \"samples\": [\n \"Specialist\",\n \"Enchanter,Warden\",\n \"Mage,Assassin\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
|
1371 |
+
}
|
1372 |
+
},
|
1373 |
+
"metadata": {},
|
1374 |
+
"execution_count": 15
|
1375 |
+
}
|
1376 |
+
]
|
1377 |
+
}
|
1378 |
+
]
|
1379 |
+
}
|