Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 91796

How to download Html table nto Excel usn python?

$
0
0

How to download "http://www.hkexnews.hk/reports/bmn/ebmn_c.htm" into excel using python? is Python the best for don such task?

My codes:

import requests
import pandas as pd
import io

url = 'https://www.hkexnews.hk/reports/bmn/ebmn_c.htm'
response = requests.get(url)

open('ebmn.csv', 'wb').write(response.content)

read_file = pd.read_csv (r'C:\A-CEO\REPORTS\STOCKS\PROFILE\Python\ebmn.csv')
read_file.to_excel (r'C:\A-CEO\REPORTS\STOCKS\PROFILE\Python\ebmn.xlsx', index = None, header=True)

Viewing all articles
Browse latest Browse all 91796

Trending Articles