My code gets into a wikipedia page, and prints the table I want. However, say i want the nth, n-1, and n-2 columns of this table.
How can i do this?
from selenium import webdriver
import pandas as pd
driver = webdriver.Chrome()
val=[]
webPage=driver.get('https://en.wikipedia.org/wiki/Economy_of_the_United_States#Data')
df=pd.read_html('https://en.wikipedia.org/wiki/Economy_of_the_United_States#Data')[1]
print(df)