i want to read the weapons table in this page and convert it into a Pandas dataframe.
I am trying with pandas read_html function but it returns only the table header and only the first column title is returned. I also tested with other stuff like BeautfulSoup with no results. The problem is similar to the one posted here, except for the fact that the proposed solution (using the flavor input of read_html) does not work in my case.
Here is my code:
from urllib.request import urlopen
import pandas as pd
import ssl
#----#
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
#----#
my_url = 'https://ps2.fisu.pw/player/?name=nixogimpo&show=weapons'
#----#
my_html = urlopen(my_url, context=ctx).read()
#----#
df = pd.read_html(str(my_html)) # flavor = "html5lib", "bs4", "lxml" does not fix
#----the table i need is the one with index 2
print(df[2])
here is the output i get
Empty DataFrame
Columns: [Weapon]
Index: []