Extract Tables from a Web Page in Python


import pandas as pd
xfiles = pd.read_html("https://en.wikipedia.org/wiki/List_of_The_X-Files_episodes")
print(xfiles) # prints all the tables on the page as list
print(type(xfiles))
print(len(xfiles))
print(xfiles[1]) # table of season 1
print(xfiles[12]) # table of season 10
   

    

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

Using insertAdjacentHTML instead of innerHTML to avoid XSS attacks

Guess The Number Game - You vs. Your Friend