0

ive been trying to scrape data from 2015-2020,but it always show error [WinError 10054] An existing connection was forcibly closed by the remote host,do you know what problem is?

import pandas as pd
import requests
url = 'https://www.bi.go.id/id/moneter/informasi-kurs/transaksi-bi/Default.aspx'
header = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0',}
r = requests.get(url, headers=headers)
df = pd.read_html(
    "https://www.bi.go.id/id/moneter/informasi-kurs/transaksi-bi/Default.aspx", header=0)[-4]
df['Tanggal'] = pd.to_datetime(df["Tanggal"])
df = df.iloc[::-1].reset_index(drop=True)
df.columns = ['nilai', 'kurs_jual', 'kurs_beli', 'tanggal']
adinda aulia
  • 183
  • 3
  • 12
  • [python: [Errno 10054] An existing connection was forcibly closed by the remote host](https://stackoverflow.com/questions/8814802/python-errno-10054-an-existing-connection-was-forcibly-closed-by-the-remote-h) – HedgeHog Nov 20 '20 at 08:19
  • sorry its still not worked – adinda aulia Nov 20 '20 at 08:41

0 Answers0