{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "source": [ " # Create the dataset for the chatbox about League of Legends Lore\n", " Author: **HOANG Caroline**\n", "\n", " The notebook is setup and runnable for Google Collab" ], "metadata": { "id": "AUdgpvdZDa2l" } }, { "cell_type": "markdown", "source": [ "## 1. Setup" ], "metadata": { "id": "ZMtrx1lED6_D" } }, { "cell_type": "markdown", "source": [ "Chrome Installation" ], "metadata": { "id": "KtlLmE3cD_hS" } }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "bULR-49jDSDU", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "232a6f85-099b-4cbd-e053-002dc700c836" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n", "Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]\n", "Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]\n", "Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]\n", "Get:5 https://r2u.stat.illinois.edu/ubuntu jammy InRelease [6,555 B]\n", "Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease [1,581 B]\n", "Get:7 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]\n", "Hit:8 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", "Hit:9 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", "Hit:10 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", "Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [3,830 kB]\n", "Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2,957 kB]\n", "Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,533 kB]\n", "Get:14 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,664 kB]\n", "Get:15 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [8,708 kB]\n", "Get:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages [1,321 kB]\n", "Get:17 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,235 kB]\n", "Get:18 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [3,688 kB]\n", "Get:19 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,649 kB]\n", "Fetched 29.0 MB in 10s (2,897 kB/s)\n", "Reading package lists...\n", "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", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "curl is already the newest version (7.81.0-1ubuntu1.20).\n", "unzip is already the newest version (6.0-26ubuntu3.2).\n", "wget is already the newest version (1.21.2-2ubuntu1.1).\n", "0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.\n", "--2025-02-28 19:43:10-- https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\n", "Resolving dl.google.com (dl.google.com)... 142.251.167.136, 142.251.167.190, 142.251.167.93, ...\n", "Connecting to dl.google.com (dl.google.com)|142.251.167.136|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 113752568 (108M) [application/x-debian-package]\n", "Saving to: ‘google-chrome-stable_current_amd64.deb’\n", "\n", "google-chrome-stabl 100%[===================>] 108.48M 247MB/s in 0.4s \n", "\n", "2025-02-28 19:43:12 (247 MB/s) - ‘google-chrome-stable_current_amd64.deb’ saved [113752568/113752568]\n", "\n", "Selecting previously unselected package google-chrome-stable.\n", "(Reading database ... 124947 files and directories currently installed.)\n", "Preparing to unpack google-chrome-stable_current_amd64.deb ...\n", "Unpacking google-chrome-stable (133.0.6943.141-1) ...\n", "\u001b[1mdpkg:\u001b[0m dependency problems prevent configuration of google-chrome-stable:\n", " google-chrome-stable depends on libvulkan1; however:\n", " Package libvulkan1 is not installed.\n", "\n", "\u001b[1mdpkg:\u001b[0m error processing package google-chrome-stable (--install):\n", " dependency problems - leaving unconfigured\n", "Processing triggers for mailcap (3.70+nmu1ubuntu1) ...\n", "Processing triggers for man-db (2.10.2-1) ...\n", "Errors were encountered while processing:\n", " google-chrome-stable\n", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "Correcting dependencies... Done\n", "The following additional packages will be installed:\n", " libvulkan1 mesa-vulkan-drivers\n", "The following NEW packages will be installed:\n", " libvulkan1 mesa-vulkan-drivers\n", "0 upgraded, 2 newly installed, 0 to remove and 30 not upgraded.\n", "1 not fully installed or removed.\n", "Need to get 10.9 MB of archives.\n", "After this operation, 51.3 MB of additional disk space will be used.\n", "Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libvulkan1 amd64 1.3.204.1-2 [128 kB]\n", "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", "Fetched 10.9 MB in 1s (10.1 MB/s)\n", "Selecting previously unselected package libvulkan1:amd64.\n", "(Reading database ... 125064 files and directories currently installed.)\n", "Preparing to unpack .../libvulkan1_1.3.204.1-2_amd64.deb ...\n", "Unpacking libvulkan1:amd64 (1.3.204.1-2) ...\n", "Selecting previously unselected package mesa-vulkan-drivers:amd64.\n", "Preparing to unpack .../mesa-vulkan-drivers_23.2.1-1ubuntu3.1~22.04.3_amd64.deb ...\n", "Unpacking mesa-vulkan-drivers:amd64 (23.2.1-1ubuntu3.1~22.04.3) ...\n", "Setting up libvulkan1:amd64 (1.3.204.1-2) ...\n", "Setting up mesa-vulkan-drivers:amd64 (23.2.1-1ubuntu3.1~22.04.3) ...\n", "Setting up google-chrome-stable (133.0.6943.141-1) ...\n", "update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode\n", "update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode\n", "update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode\n", "Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n", "\n", "Reading package lists... Done\n", "Building dependency tree... Done\n", "Reading state information... Done\n", "libasound2 is already the newest version (1.2.6.1-1ubuntu1).\n", "libasound2 set to manually installed.\n", "libxi6 is already the newest version (2:1.8-1build1).\n", "libxi6 set to manually installed.\n", "libxss1 is already the newest version (1:1.2.3-1build2).\n", "libxss1 set to manually installed.\n", "libnss3 is already the newest version (2:3.98-0ubuntu0.22.04.2).\n", "libnss3 set to manually installed.\n", "libx11-dev is already the newest version (2:1.7.5-1ubuntu0.3).\n", "libx11-dev set to manually installed.\n", "libx11-xcb1 is already the newest version (2:1.7.5-1ubuntu0.3).\n", "libx11-xcb1 set to manually installed.\n", "Suggested packages:\n", " indicator-application\n", "The following NEW packages will be installed:\n", " gconf-service gconf-service-backend gconf2-common libappindicator3-1 libdbus-glib-1-2\n", " libdbusmenu-glib4 libdbusmenu-gtk3-4 libgconf-2-4 libglu1-mesa libxtst6\n", "0 upgraded, 10 newly installed, 0 to remove and 30 not upgraded.\n", "Need to get 1,184 kB of archives.\n", "After this operation, 9,107 kB of additional disk space will be used.\n", "Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbus-glib-1-2 amd64 0.112-2build1 [65.4 kB]\n", "Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf2-common all 3.2.6-7ubuntu2 [698 kB]\n", "Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libgconf-2-4 amd64 3.2.6-7ubuntu2 [86.0 kB]\n", "Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf-service-backend amd64 3.2.6-7ubuntu2 [59.3 kB]\n", "Get:5 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gconf-service amd64 3.2.6-7ubuntu2 [17.4 kB]\n", "Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libdbusmenu-glib4 amd64 16.04.1+18.10.20180917-0ubuntu8 [45.4 kB]\n", "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", "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", "Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxtst6 amd64 2:1.2.3-1build4 [13.4 kB]\n", "Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libglu1-mesa amd64 9.0.2-1 [145 kB]\n", "Fetched 1,184 kB in 1s (1,549 kB/s)\n", "Selecting previously unselected package libdbus-glib-1-2:amd64.\n", "(Reading database ... 125102 files and directories currently installed.)\n", "Preparing to unpack .../0-libdbus-glib-1-2_0.112-2build1_amd64.deb ...\n", "Unpacking libdbus-glib-1-2:amd64 (0.112-2build1) ...\n", "Selecting previously unselected package gconf2-common.\n", "Preparing to unpack .../1-gconf2-common_3.2.6-7ubuntu2_all.deb ...\n", "Unpacking gconf2-common (3.2.6-7ubuntu2) ...\n", "Selecting previously unselected package libgconf-2-4:amd64.\n", "Preparing to unpack .../2-libgconf-2-4_3.2.6-7ubuntu2_amd64.deb ...\n", "Unpacking libgconf-2-4:amd64 (3.2.6-7ubuntu2) ...\n", "Selecting previously unselected package gconf-service-backend.\n", "Preparing to unpack .../3-gconf-service-backend_3.2.6-7ubuntu2_amd64.deb ...\n", "Unpacking gconf-service-backend (3.2.6-7ubuntu2) ...\n", "Selecting previously unselected package gconf-service.\n", "Preparing to unpack .../4-gconf-service_3.2.6-7ubuntu2_amd64.deb ...\n", "Unpacking gconf-service (3.2.6-7ubuntu2) ...\n", "Selecting previously unselected package libdbusmenu-glib4:amd64.\n", "Preparing to unpack .../5-libdbusmenu-glib4_16.04.1+18.10.20180917-0ubuntu8_amd64.deb ...\n", "Unpacking libdbusmenu-glib4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n", "Selecting previously unselected package libdbusmenu-gtk3-4:amd64.\n", "Preparing to unpack .../6-libdbusmenu-gtk3-4_16.04.1+18.10.20180917-0ubuntu8_amd64.deb ...\n", "Unpacking libdbusmenu-gtk3-4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n", "Selecting previously unselected package libappindicator3-1.\n", "Preparing to unpack .../7-libappindicator3-1_12.10.1+20.10.20200706.1-0ubuntu1_amd64.deb ...\n", "Unpacking libappindicator3-1 (12.10.1+20.10.20200706.1-0ubuntu1) ...\n", "Selecting previously unselected package libxtst6:amd64.\n", "Preparing to unpack .../8-libxtst6_2%3a1.2.3-1build4_amd64.deb ...\n", "Unpacking libxtst6:amd64 (2:1.2.3-1build4) ...\n", "Selecting previously unselected package libglu1-mesa:amd64.\n", "Preparing to unpack .../9-libglu1-mesa_9.0.2-1_amd64.deb ...\n", "Unpacking libglu1-mesa:amd64 (9.0.2-1) ...\n", "Setting up libxtst6:amd64 (2:1.2.3-1build4) ...\n", "Setting up libdbusmenu-glib4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n", "Setting up gconf2-common (3.2.6-7ubuntu2) ...\n", "\n", "Creating config file /etc/gconf/2/path with new version\n", "Setting up libdbus-glib-1-2:amd64 (0.112-2build1) ...\n", "Setting up libglu1-mesa:amd64 (9.0.2-1) ...\n", "Setting up libdbusmenu-gtk3-4:amd64 (16.04.1+18.10.20180917-0ubuntu8) ...\n", "Setting up libgconf-2-4:amd64 (3.2.6-7ubuntu2) ...\n", "Setting up libappindicator3-1 (12.10.1+20.10.20200706.1-0ubuntu1) ...\n", "Setting up gconf-service (3.2.6-7ubuntu2) ...\n", "Setting up gconf-service-backend (3.2.6-7ubuntu2) ...\n", "Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n", "\n", "/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n", "\n", "Archive: chromedriver_linux64.zip\n", " inflating: chromedriver \n", " inflating: LICENSE.chromedriver \n" ] } ], "source": [ "# Install Chrome\n", "!apt-get update -q\n", "!apt-get install -y wget curl unzip\n", "!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\n", "!dpkg -i google-chrome-stable_current_amd64.deb\n", "!apt --fix-broken install -y\n", "\n", "# Install dependencies for Chrome\n", "!apt-get install -y libx11-dev libx11-xcb1 libglu1-mesa libxi6 libgconf-2-4 libnss3 libxss1 libappindicator3-1 libasound2 libxtst6\n", "\n", "# Install ChromeDriver\n", "!wget -q https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip\n", "!unzip chromedriver_linux64.zip\n", "!mv chromedriver /usr/bin/chromedriver\n", "!chmod +x /usr/bin/chromedriver" ] }, { "cell_type": "markdown", "source": [ "Packages" ], "metadata": { "id": "8yLARgacEDjR" } }, { "cell_type": "code", "source": [ "pip install selenium webdriver-manager" ], "metadata": { "id": "Hb2k8Lh1EEbn", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "7cec1b5a-f78b-48d9-89be-7dcced16ec3b" }, "execution_count": 5, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: selenium in /usr/local/lib/python3.11/dist-packages (4.29.0)\n", "Requirement already satisfied: webdriver-manager in /usr/local/lib/python3.11/dist-packages (4.0.2)\n", "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", "Requirement already satisfied: trio~=0.17 in /usr/local/lib/python3.11/dist-packages (from selenium) (0.29.0)\n", "Requirement already satisfied: trio-websocket~=0.9 in /usr/local/lib/python3.11/dist-packages (from selenium) (0.12.2)\n", "Requirement already satisfied: certifi>=2021.10.8 in /usr/local/lib/python3.11/dist-packages (from selenium) (2025.1.31)\n", "Requirement already satisfied: typing_extensions~=4.9 in /usr/local/lib/python3.11/dist-packages (from selenium) (4.12.2)\n", "Requirement already satisfied: websocket-client~=1.8 in /usr/local/lib/python3.11/dist-packages (from selenium) (1.8.0)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (2.32.3)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (1.0.1)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from webdriver-manager) (24.2)\n", "Requirement already satisfied: attrs>=23.2.0 in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (25.1.0)\n", "Requirement already satisfied: sortedcontainers in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (2.4.0)\n", "Requirement already satisfied: idna in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (3.10)\n", "Requirement already satisfied: outcome in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (1.3.0.post0)\n", "Requirement already satisfied: sniffio>=1.3.0 in /usr/local/lib/python3.11/dist-packages (from trio~=0.17->selenium) (1.3.1)\n", "Requirement already satisfied: wsproto>=0.14 in /usr/local/lib/python3.11/dist-packages (from trio-websocket~=0.9->selenium) (1.2.0)\n", "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", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->webdriver-manager) (3.4.1)\n", "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" ] } ] }, { "cell_type": "markdown", "source": [ "## 2. Retrieve texts from website\n", "\n", "###Methodology\n", "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", "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", "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", "3. We create a dataframe that include the name of the champion associated with its role and story." ], "metadata": { "id": "fy-ph5nDEoWp" } }, { "cell_type": "markdown", "source": [ "## Step 1: Collect champions name" ], "metadata": { "id": "fj2MCu5WGyDw" } }, { "cell_type": "code", "source": [ "import requests\n", "from bs4 import BeautifulSoup\n", "\n", "# URL of the list of champions\n", "url = \"https://leagueoflegends.fandom.com/wiki/List_of_champions\"\n", "\n", "# Send a GET request to fetch the page\n", "response = requests.get(url)\n", "\n", "# Parse the HTML content using BeautifulSoup\n", "soup = BeautifulSoup(response.text, 'html.parser')\n", "\n", "# Find all td tags with the data-sort-value attribute\n", "champion_td_tags = soup.find_all('td', attrs={'data-sort-value': True})\n", "\n", "# Extract the champion names from the data-sort-value attribute\n", "champions = [tag['data-sort-value'] for tag in champion_td_tags]" ], "metadata": { "id": "c3ckS_EpGz20" }, "execution_count": 6, "outputs": [] }, { "cell_type": "code", "source": [ "# Create champions name and role list from the previous extraction\n", "champions_name, champions_role = [], []\n", "for i, value in enumerate(champions):\n", " if i % 3 == 0:\n", " champions_name.append(value)\n", " if i % 3 == 1:\n", " champions_role.append(value)" ], "metadata": { "id": "eNdAqgrmG7ix" }, "execution_count": 7, "outputs": [] }, { "cell_type": "code", "source": [ "champions_name" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Ii1Pn1nVF4dI", "outputId": "7784479c-1c89-45b0-b90a-9d9050971cb3" }, "execution_count": 9, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "['Aatrox',\n", " 'Ahri',\n", " 'Akali',\n", " 'Akshan',\n", " 'Alistar',\n", " 'Ambessa',\n", " 'Amumu',\n", " 'Anivia',\n", " 'Annie',\n", " 'Aphelios',\n", " 'Ashe',\n", " 'Aurelion Sol',\n", " 'Aurora',\n", " 'Azir',\n", " 'Bard',\n", " \"Bel'Veth\",\n", " 'Blitzcrank',\n", " 'Brand',\n", " 'Braum',\n", " 'Briar',\n", " 'Caitlyn',\n", " 'Camille',\n", " 'Cassiopeia',\n", " \"Cho'Gath\",\n", " 'Corki',\n", " 'Darius',\n", " 'Diana',\n", " 'Dr. Mundo',\n", " 'Draven',\n", " 'Ekko',\n", " 'Elise',\n", " 'Evelynn',\n", " 'Ezreal',\n", " 'Fiddlesticks',\n", " 'Fiora',\n", " 'Fizz',\n", " 'Galio',\n", " 'Gangplank',\n", " 'Garen',\n", " 'Gnar',\n", " 'Gragas',\n", " 'Graves',\n", " 'Gwen',\n", " 'Hecarim',\n", " 'Heimerdinger',\n", " 'Hwei',\n", " 'Illaoi',\n", " 'Irelia',\n", " 'Ivern',\n", " 'Janna',\n", " 'Jarvan IV',\n", " 'Jax',\n", " 'Jayce',\n", " 'Jhin',\n", " 'Jinx',\n", " \"K'Sante\",\n", " \"Kai'Sa\",\n", " 'Kalista',\n", " 'Karma',\n", " 'Karthus',\n", " 'Kassadin',\n", " 'Katarina',\n", " 'Kayle',\n", " 'Kayn',\n", " 'Kennen',\n", " \"Kha'Zix\",\n", " 'Kindred',\n", " 'Kled',\n", " \"Kog'Maw\",\n", " 'LeBlanc',\n", " 'Lee Sin',\n", " 'Leona',\n", " 'Lillia',\n", " 'Lissandra',\n", " 'Lucian',\n", " 'Lulu',\n", " 'Lux',\n", " 'Malphite',\n", " 'Malzahar',\n", " 'Maokai',\n", " 'Master Yi',\n", " 'Milio',\n", " 'Miss Fortune',\n", " 'Mordekaiser',\n", " 'Morgana',\n", " 'Naafiri',\n", " 'Nami',\n", " 'Nasus',\n", " 'Nautilus',\n", " 'Neeko',\n", " 'Nidalee',\n", " 'Nilah',\n", " 'Nocturne',\n", " 'Nunu & Willump',\n", " 'Olaf',\n", " 'Orianna',\n", " 'Ornn',\n", " 'Pantheon',\n", " 'Poppy',\n", " 'Pyke',\n", " 'Qiyana',\n", " 'Quinn',\n", " 'Rakan',\n", " 'Rammus',\n", " \"Rek'Sai\",\n", " 'Rell',\n", " 'Renata Glasc',\n", " 'Renekton',\n", " 'Rengar',\n", " 'Riven',\n", " 'Rumble',\n", " 'Ryze',\n", " 'Samira',\n", " 'Sejuani',\n", " 'Senna',\n", " 'Seraphine',\n", " 'Sett',\n", " 'Shaco',\n", " 'Shen',\n", " 'Shyvana',\n", " 'Singed',\n", " 'Sion',\n", " 'Sivir',\n", " 'Skarner',\n", " 'Smolder',\n", " 'Sona',\n", " 'Soraka',\n", " 'Swain',\n", " 'Sylas',\n", " 'Syndra',\n", " 'Tahm Kench',\n", " 'Taliyah',\n", " 'Talon',\n", " 'Taric',\n", " 'Teemo',\n", " 'Thresh',\n", " 'Tristana',\n", " 'Trundle',\n", " 'Tryndamere',\n", " 'Twisted Fate',\n", " 'Twitch',\n", " 'Udyr',\n", " 'Urgot',\n", " 'Varus',\n", " 'Vayne',\n", " 'Veigar',\n", " \"Vel'Koz\",\n", " 'Vex',\n", " 'Vi',\n", " 'Viego',\n", " 'Viktor',\n", " 'Vladimir',\n", " 'Volibear',\n", " 'Warwick',\n", " 'Wukong',\n", " 'Xayah',\n", " 'Xerath',\n", " 'Xin Zhao',\n", " 'Yasuo',\n", " 'Yone',\n", " 'Yorick',\n", " 'Yuumi',\n", " 'Zac',\n", " 'Zed',\n", " 'Zeri',\n", " 'Ziggs',\n", " 'Zilean',\n", " 'Zoe',\n", " 'Zyra']" ] }, "metadata": {}, "execution_count": 9 } ] }, { "cell_type": "code", "source": [ "'Dr. Mundo'.replace(\". \", \"\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 35 }, "id": "6ijPGMAJGJOB", "outputId": "dd0fa11f-e003-4d5c-ebef-72311c535025" }, "execution_count": 10, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "'DrMundo'" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" } }, "metadata": {}, "execution_count": 10 } ] }, { "cell_type": "markdown", "source": [ "## Step 2: Extract its lore" ], "metadata": { "id": "_ZKEjxbFG-o9" } }, { "cell_type": "code", "source": [ "import requests\n", "from bs4 import BeautifulSoup\n", "champions_data = []\n", "import pandas as pd\n", "from selenium import webdriver\n", "from selenium.webdriver.chrome.service import Service\n", "from webdriver_manager.chrome import ChromeDriverManager\n", "from selenium.webdriver.common.by import By\n", "from selenium.webdriver.chrome.options import Options\n", "from selenium.webdriver.support.ui import WebDriverWait\n", "from selenium.webdriver.support import expected_conditions as EC\n", "import time\n", "\n", "# List of champions\n", "champions = champions_name\n", "# Configure options for headless Chrome\n", "chrome_options = Options()\n", "chrome_options.add_argument(\"--headless\")\n", "chrome_options.add_argument(\"--no-sandbox\")\n", "chrome_options.add_argument(\"--disable-dev-shm-usage\")\n", "service = Service(ChromeDriverManager().install())\n", "\n", "# Function to scrape champion data and store it\n", "def scrape_champion_data(champion_name):\n", " # Assuming champion_name is a string\n", " champion_name = champion_name.replace(\" \", \"\") # Remove spaces\n", " champion_name = champion_name.replace(\"'\", \"\") # Remove apostrophes\n", " champion_name = champion_name.replace(\".\", \"\") # Remove dot\n", " if champion_name == \"nunu&willump\":\n", " champion_name = \"nunu\"\n", " url = f\"https://universe.leagueoflegends.com/en_GB/story/champion/{champion_name}/\"\n", " print(url)\n", " # Send a GET request to fetch the page\n", " response = requests.get(url)\n", " response.encoding = 'utf-8' # Set the encoding to UTF-8, or use response.apparent_encoding\n", " # Parse the HTML content using BeautifulSoup\n", " soup = BeautifulSoup(response.text, 'html.parser')\n", "\n", " # Find the tag with the biography content\n", " meta_tag = soup.find('meta', attrs={'name': 'description'})\n", " if meta_tag and champion_name != \"ambessa\":\n", " biography_text = meta_tag.get('content')\n", " champions_data.append({\n", " \"Champion\": champion_name,\n", " \"Text\": biography_text\n", " })\n", " else:\n", " try:\n", "\n", " browser = webdriver.Chrome(service=service, options=chrome_options)\n", "\n", " # Construct URL for the champion\n", " url = f\"https://universe.leagueoflegends.com/en_GB/story/champion/{champion_name}/\"\n", "\n", " # Open the page\n", " browser.get(url)\n", "\n", " # Wait for the page to load and the desired element to be visible\n", " WebDriverWait(browser, 10).until(\n", " EC.presence_of_element_located((By.CLASS_NAME, \"root_3nvd.dark_1RHo\"))\n", " )\n", "\n", " # Scroll down to ensure content is loaded\n", " browser.execute_script(\"window.scrollTo(0, document.body.scrollHeight / 2);\")\n", "\n", " # Extract the text content\n", " element = browser.find_element(By.CLASS_NAME, \"root_3nvd.dark_1RHo\")\n", " text_content = element.text\n", "\n", " # Append the data to the list\n", " champions_data.append({\n", " \"Champion\": champion_name,\n", " \"Text\": text_content\n", " })\n", " browser.quit()\n", " except:\n", " champions_data.append({\n", " \"Champion\": champion_name,\n", " \"Text\": f\"Biography content not found for {champion_name}.\"\n", " })\n", " print(\"Biography content not found.\")\n", "# Loop through the champions and scrape data\n", "for champion in champions:\n", " scrape_champion_data(champion.lower())\n" ], "metadata": { "id": "wlz85RVREnkp", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "d60072ac-33cd-4dbf-d82e-f36cad4ab33d" }, "execution_count": 13, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "https://universe.leagueoflegends.com/en_GB/story/champion/aatrox/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ahri/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/akali/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/akshan/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/alistar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ambessa/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/amumu/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/anivia/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/annie/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/aphelios/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ashe/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/aurelionsol/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/aurora/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/azir/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/bard/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/belveth/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/blitzcrank/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/brand/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/braum/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/briar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/caitlyn/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/camille/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/cassiopeia/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/chogath/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/corki/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/darius/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/diana/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/drmundo/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/draven/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ekko/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/elise/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/evelynn/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ezreal/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/fiddlesticks/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/fiora/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/fizz/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/galio/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/gangplank/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/garen/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/gnar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/gragas/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/graves/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/gwen/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/hecarim/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/heimerdinger/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/hwei/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/illaoi/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/irelia/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ivern/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/janna/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/jarvaniv/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/jax/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/jayce/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/jhin/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/jinx/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ksante/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kaisa/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kalista/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/karma/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/karthus/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kassadin/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/katarina/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kayle/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kayn/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kennen/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/khazix/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kindred/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kled/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/kogmaw/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/leblanc/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/leesin/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/leona/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/lillia/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/lissandra/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/lucian/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/lulu/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/lux/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/malphite/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/malzahar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/maokai/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/masteryi/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/milio/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/missfortune/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/mordekaiser/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/morgana/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/naafiri/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nami/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nasus/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nautilus/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/neeko/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nidalee/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nilah/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nocturne/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/nunu/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/olaf/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/orianna/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ornn/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/pantheon/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/poppy/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/pyke/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/qiyana/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/quinn/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/rakan/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/rammus/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/reksai/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/rell/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/renataglasc/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/renekton/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/rengar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/riven/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/rumble/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ryze/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/samira/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sejuani/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/senna/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/seraphine/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sett/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/shaco/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/shen/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/shyvana/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/singed/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sion/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sivir/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/skarner/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/smolder/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sona/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/soraka/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/swain/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/sylas/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/syndra/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/tahmkench/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/taliyah/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/talon/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/taric/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/teemo/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/thresh/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/tristana/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/trundle/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/tryndamere/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/twistedfate/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/twitch/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/udyr/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/urgot/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/varus/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/vayne/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/veigar/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/velkoz/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/vex/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/vi/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/viego/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/viktor/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/vladimir/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/volibear/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/warwick/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/wukong/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/xayah/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/xerath/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/xinzhao/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/yasuo/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/yone/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/yorick/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/yuumi/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zac/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zed/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zeri/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/ziggs/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zilean/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zoe/\n", "https://universe.leagueoflegends.com/en_GB/story/champion/zyra/\n" ] } ] }, { "cell_type": "markdown", "source": [ "## Step 3: Transform into dataframe" ], "metadata": { "id": "ESQDGQl2HDvW" } }, { "cell_type": "code", "source": [ "# Create a DataFrame from the list of champions data\n", "df1 = pd.DataFrame(champions_data)\n", "\n", "# Rename columns\n", "df1.columns = ['Champion', 'Story']\n", "\n", "# Add champions role\n", "df1['Role'] = champions_role\n", "\n", "# Undo the champions name changed for url\n", "df1['Champion'] = champions_name\n", "\n", "# Save it to a CSV file if you want\n", "df1.to_csv(\"champions_data.csv\", index=False)" ], "metadata": { "id": "AHCHv4EJHGyg" }, "execution_count": 16, "outputs": [] }, { "cell_type": "code", "source": [ "df1" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 423 }, "id": "79wwP4P5HNPf", "outputId": "39185e1f-633b-42ad-8d11-1681edd13c66" }, "execution_count": 15, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Champion Story \\\n", "0 Aatrox Whether mistaken for a demon or god, many tale... \n", "1 Ahri For most of her life, Ahri's origins were a my... \n", "2 Akali Ionia has always been a land of wild magic, it... \n", "3 Akshan Dashing through the shadows of eastern Shurima... \n", "4 Alistar Many civilizations have resisted Noxus, but no... \n", ".. ... ... \n", "164 Zeri Raised in a large working-class family, Zeri g... \n", "165 Ziggs Ziggs was born with a talent for tinkering, bu... \n", "166 Zilean Icathia, most desolate and cursed of lands, wa... \n", "167 Zoe As befits her Targonian Aspect’s nature, Zoe d... \n", "168 Zyra Zyra’s memory is long, and runs as deep as the... \n", "\n", " Role \n", "0 Juggernaut \n", "1 Burst \n", "2 Assassin \n", "3 Marksman,Assassin \n", "4 Vanguard \n", ".. ... \n", "164 Marksman \n", "165 Artillery \n", "166 Specialist \n", "167 Burst \n", "168 Catcher \n", "\n", "[169 rows x 3 columns]" ], "text/html": [ "\n", "
\n", " | Champion | \n", "Story | \n", "Role | \n", "
---|---|---|---|
0 | \n", "Aatrox | \n", "Whether mistaken for a demon or god, many tale... | \n", "Juggernaut | \n", "
1 | \n", "Ahri | \n", "For most of her life, Ahri's origins were a my... | \n", "Burst | \n", "
2 | \n", "Akali | \n", "Ionia has always been a land of wild magic, it... | \n", "Assassin | \n", "
3 | \n", "Akshan | \n", "Dashing through the shadows of eastern Shurima... | \n", "Marksman,Assassin | \n", "
4 | \n", "Alistar | \n", "Many civilizations have resisted Noxus, but no... | \n", "Vanguard | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "
164 | \n", "Zeri | \n", "Raised in a large working-class family, Zeri g... | \n", "Marksman | \n", "
165 | \n", "Ziggs | \n", "Ziggs was born with a talent for tinkering, bu... | \n", "Artillery | \n", "
166 | \n", "Zilean | \n", "Icathia, most desolate and cursed of lands, wa... | \n", "Specialist | \n", "
167 | \n", "Zoe | \n", "As befits her Targonian Aspect’s nature, Zoe d... | \n", "Burst | \n", "
168 | \n", "Zyra | \n", "Zyra’s memory is long, and runs as deep as the... | \n", "Catcher | \n", "
169 rows × 3 columns
\n", "