I am trying to scrape a the first table which is the ten countries with biggest biggest market capitalization table I have written the code but the table is not printed it is giving me out that is not correct this is the code ”’# Code for ETL operations on Country-GDP data
Importing the required libraries
import pandas as pd
import requests
from bs4 import BeautifulSoup
url=”https://web.archive.org/web/20230908091635/https://en.wikipedia.org/wiki/List_of_largest_banks”
Function to extract data using read_html
def extract(url):
”’ This function aims to extract the required
information from the website and save it to a data frame. The
function returns the data frame for further processing. ”’
response = requests.get(url).text
soup = BeautifulSoup(response, 'html.parser')
df = pd.DataFrame(soup)
tables = soup.find_all('tbody')
rows = tables[0].find_all('tr')
for row in rows:
col = row.find_all('td')
return df
Call the function and print the DataFrame
df = extract(url)
print(df)”’