【发布时间】:2021-08-25 07:48:40
【问题描述】:
我正在使用 python & beautifulsoup 来提取数据,但由于某种原因它没有看到文本值。
HTML 页面有:
<div ng-if="!order.hidePrices" style="white-space: nowrap;" class="ng-binding ng-scope">$ 1,599.00</div>
Python 代码:
for price in prices:
price_value = price.find('div', {"class":"ng-binding", "class":"ng-scope"})
print(price_value)
而python输出缺少文本值:
<div class="ng-binding ng-scope" ng-if="!order.hidePrices" style="white-space: nowrap;"></div>
HTML 文件没有其他同名的类。我哪里做错了?
【问题讨论】:
标签: python selenium selenium-chromedriver