Created
June 27, 2020 15:45
-
-
Save venkatavamsy/d596e6b231c3336cac7327b0d2685436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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