开发者

Grab img filename from id using Selenium RC

开发者 https://www.devze.com 2023-01-19 13:54 出处:网络
I\'m trying to grab the image filename - my webpage, based on inputs, is loading on of several images and I want to grab the filename of the image.If I know the id or the alt-text, can I grab the imag

I'm trying to grab the image filename - my webpage, based on inputs, is loading on of several images and I want to grab the filename of the image. If I know the id or the alt-text, can I grab the image filename? Right now, I'm using "get_html_source" (python, btw) and parsing it from there. Is there an alternative,开发者_运维技巧 or is selenium not really built for this?


Use get_attribute:

sel.get_attribute('//path/to/my/img@src')
0

精彩评论

暂无评论...
验证码 换一张
取 消