社区所有版块导航
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进行web抓取-获取属性值时出现问题[duplicate]

Monkeydave • 5 年前 • 1645 次点击  

我对网络垃圾很陌生,我正努力从特定元素中获取两个属性的值

我想找到 data-diffusion-decimal 和; data-diffusion-history

enter image description here

soup.findAll('div',attrs={"class":"RC-runnerPriceWrapper"})

我得到的是:

<div class="RC-runnerPriceWrapper PC-bestOddsContainer js-diffusionHorsesList js-horsesList js-bestOddsPriceContainer" data-diffusion-horsename="Dinons">  <a class="ui-btn RC-runnerPrice ui-priceBtn_noPrice js-diffusionPriceValue js-betHandler js-runnerPrice js-runnerPriceBestOdds" data-test-selector="RC-cardPage-runnerPrice" href="#"></a>

这是我所能得到的,但我所需要的并不包含在结果中。非常感谢任何建议

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