import requestsfrom bs4 import BeautifulSoupimport pandas as pd# Define the URL of the Wikipedia pageurl ="https://en.wikipedia.org/wiki/List_of_constituencies_of_the_Telangana_Legislative_Assembly"# Send an HTTP GET request to the URLresponse = requests.get(url)# Parse the HTML content of the page using BeautifulSoupsoup = BeautifulSoup(response.content, "html.parser")# Find the table containing the constituency datatable = soup.find("table", {"class": "wikitable"})# Initialize empty lists to store dataconstituencies = []latitude = [] # You would need to populate this with actual latitude datalongitude = [] # You would need to populate this with actual longitude data# Extract data from the tablefor row in table.find_all("tr")[1:]: # Skip the header row columns = row.find_all("td") constituency_name = columns[0].text.strip()# Append the data to the lists (latitude and longitude need to be filled) constituencies.append(constituency_name) latitude.append(None) # Replace None with actual latitude data longitude.append(None) # Replace None with actual longitude data# Create a DataFrame using pandasconstituency_df = pd.DataFrame({"Constituency Name": constituencies,"Latitude": latitude,"Longitude": longitude})# Print the DataFrameprint(constituency_df)