【发布时间】:2019-07-19 14:09:35
【问题描述】:
我有如下代码的源代码。我正在尝试刮掉“11只老虎”的字符串。我是 xpath 的新手,谁能建议如何使用硒或美丽的汤来获得它?我在想driver.find_element_by_xpath 或soup.find_all。
来源:
<div class="count-box fixed_when_handheld s-vgLeft0_5 s-vgPullBottom1 s-vgRight0_5 u-colorGray6 u-fontSize18 u-fontWeight200" style="display: block;">
<div class="label-container u-floatLeft">11 tigers</div>
<div class="u-floatRight">
<div class="hide_when_tablet hide_when_desktop s-vgLeft0_5 s-vgRight0_5 u-textAlignCenter">
<div class="js-show-handheld-filters c-button c-button--md c-button--blue s-vgRight1">
Filter
</div>
<div class="js-save-handheld-filters c-button c-button--md c-button--transparent">
Save
</div>
</div>
</div>
<div class="cb"></div>
</div>
【问题讨论】:
标签: python-3.x selenium xpath beautifulsoup css-selectors