Py学习  »  Python

使用python进行web抓取-获取属性值时出现问题[duplicate]

Monkeydave • 5 年前 • 1647 次点击  

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

我想找到 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
 
1647 次点击  
文章 [ 2 ]  |  最新文章 5 年前