Getting the entire cell information with Beautiful Soup/Web Scraping

I’m trying to web scrape this table of weapon stats from the game Final Fantasy XIII (https://finalfantasy.fandom.com/wiki/Final_Fantasy_XIII_weapons). How can I put in a list the entire content of each cell? My code is like:

summary = soup.find('div',{'class':'mw-content-ltr mw-content-text','id':'mw-content-text'})
tables = summary.find_all('table')
data = []
rows = tables[0].findAll('tr')

for tr in rows:
    cols = tr.findAll('td')
    
    for td in cols:
        text = td.find(text=True)
        print(text)
        data.append(text)
name = []
rank = []
strenght = []
magic = []
exp = []
acquirement = []
dismantle = []

index = 0

for item in data:
    if 'EXP' in item:
        dismantle.append(data[index+2])
        acquirement.append(data[index+1])
        exp.append(data[index])
        magic.append(data[index-3])
        strenght.append(data[index-4])
        rank.append(data[index-5])
        name.append(data[index-7])
    index += 1

it’s working fine for the cells that have a single data inside the <td>, but for entries in which the <td have multiple tags formatting the content, it only grabs the first piece of data on the cell.

For example, in strenght[0] the value I got is 15 when it should be 15 (Min) 115 (Max)

Answer

You should change the line:

text = td.find(text=True)

by

text = td.get_text()

and you will get all the text inside the cell, e.g. 15 (Min) 115 (Max) in place of 15