社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

在python中使用beautifulsoup获取href URL

user86907 • 3 年前 • 1423 次点击  

我正在尝试从以下url下载所有csv文件: https://emi.ea.govt.nz/Wholesale/Datasets/FinalPricing/EnergyPrices ,但不幸的是,我未能如期成功。以下是我的尝试:

soup = BeautifulSoup(page.content, "html.parser")
market_dataset = soup.findAll("table",{"class":"table table-striped table-condensed table-clean"})
for a in market_dataset.find_all('a', href=True):
    print("Found the URL:", a['href'])

谁能帮帮我吗。如何获取csv文件的所有URL。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/129416
 
1423 次点击  
文章 [ 1 ]  |  最新文章 3 年前