下午好,
我对Webscraping非常陌生。我正在尝试从开源门户网站抓取数据集。只是为了弄清楚如何抓取网站。 我正在尝试从data.toerismevlaanderen.be换一个数据集 这是我想要的数据集:https://data.toerismevlaanderen.be/tourist/reca/beer_bars
我总是以http错误结尾:HTTP错误404:找不到
这是我的代码:
import requests
import urllib.request
import time
from bs4 import BeautifulSoup
url = 'https://data.toerismevlaanderen.be/'
response = requests.get(url)
soup = BeautifulSoup(response.text,'html.parser')
soup.findAll('a')
one_a_tag = soup.findAll('a')[35]
link = one_a_tag['href']
download_url = 'https://data.toerismevlaanderen.be/'+ link
urllib.request.urlretrieve(download_url,'./'+link[link.find('/tourist/reca/beer_bars_')+1:])
time.sleep
我在做什么错了?