

I created a function convertSymbol() to translate an image alt of a mana symbol to its corresponding abbreviation.Ī card’s mana cost consists of images with alt text This will need to be converted to an abbreviated color code that most users go by.

Mana cost can be found as a series of images right next to the card name. To get started with scraping the Gatherer website, we can use the following three lines of code to grab all the cards on the current page: page = r.get("") soup = bs(ntent, 'html.parser') cardItem = soup("tr", attrs=).text.strip() manaCost import requests as r from bs4 import BeautifulSoup as bs

BeautifulSoup is a library that makes scraping information from web pages very easy. I scraped the Gatherer website using Python and BeautifulSoup. Looks easy at first, but if you know Magic: The Gathering, you know that cards get a lot more complicated.
