import pandas as pd
my_data = pd.read_clipboard()
print(my_data)
my_data.to_csv('D:\my_clipboard.csv')
Next time by using your mouse select data in any web page ( url ) or excel file or any other Tabular data. Run the above code and take your CSV or Excel file from D drive ( or location of your choice ) .
Creating HTML page by using to_html()
We can use the clipboard data to create HTML tables and save the file as web page or in .html format by using to_html(). Here is the code.
import pandas as pd
my_data = pd.read_clipboard()
print(my_data)
my_data.to_html('D:\my_html.html')
The above code will create my_html.html file at D Drive ( change the location if you want ) . The source code of this file is here