我正在尝试抓取网页(“coinmarketcap”)。我正在抓取所有加密货币从 2013 年到 2019 年 10 月(开盘价、最高价、最低价、收盘价、市值、成交量)的数据。
for j in range (0,name_size):
url = ("https://coinmarketcap.com/currencies/" + str(name[j]) + "/historical-data/?start=20130429&end=20191016")
page = urllib.request.urlopen(url)
soup = BeautifulSoup(page, 'html.parser')
priceDiv = soup.find('div', attrs={'class':'table-responsive'})
rows = priceDiv.find_all('tr')
问题是某些网址不存在。我不知道如何跳过这些。你能帮我么?
料青山看我应如是
人到中年有点甜
一只斗牛犬
随时随地看视频慕课网APP
相关分类