Skip to content

Instantly share code, notes, and snippets.

@venkatavamsy
Created June 27, 2020 15:45
Show Gist options
  • Select an option

  • Save venkatavamsy/d596e6b231c3336cac7327b0d2685436 to your computer and use it in GitHub Desktop.

Select an option

Save venkatavamsy/d596e6b231c3336cac7327b0d2685436 to your computer and use it in GitHub Desktop.
#pip install pandas
#pip install lxml
#pip install openpyxl
# Importing pandas
import pandas as pd
# The webpage URL whose table we want to extract
url = "https://www.moneycontrol.com/mutual-funds/canara-robeco-blue-chip-equity-fund-direct-plan/portfolio-holdings/"
# Assign the table data to a Pandas dataframe
table = pd.read_html(url)
print(table)
# Store the dataframe in Excel file
table.to_excel("data.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment