【发布时间】:2020-10-02 19:03:44
【问题描述】:
<div style="left: 0%;background-image: url("https://i.xxxx.com/pictures/3724063802.jpg?type=original");width: 100%;height: 100%;background-size: contain;background-position: 50% 50%;background-repeat: no-repeat;position: absolute;"></div>
如何使用 Python 从 selenium 中的上述 html 中定位和提取背景图像 URL? 我的问题是我之前用过id,没有id怎么办?
【问题讨论】:
-
使用 css_selector。右键单击元素并检查并复制选择器。然后解析它。