xpath读取图片的src属性
时间: 2023-08-27 12:06:57 浏览: 496
DOM XPATH获取img src值的query
XPath可以用来读取图片的src属性。在XPath中,可以使用`@src`来获取元素的src属性。例如,如果要读取一个图片元素的src属性,可以使用以下XPath表达式:`//img/@src`。这将返回所有图片元素的src属性值。
#### 引用[.reference_title]
- *1* [站长素材爬取图片(xpath遇到的问题)](https://blog.csdn.net/m0_57753629/article/details/128638474)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [xpath获取标签的属性值_现学活用的XPath爬取豆瓣音乐](https://blog.csdn.net/weixin_39667509/article/details/109961026)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [xpath获取标签的属性值_Python现学现用xpath爬取豆瓣音乐!](https://blog.csdn.net/weixin_39683526/article/details/109961007)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文