I'm trying to extract srcset
attribute of a img
tag using pyquery & python3.
<img alt="my-image" srcset="//url/i/need/to/extract">
Extracting alt
attribute works like expected, and returns "my-image"
(".item-thumb img").attr('alt')
But this method doesn't work for the attribute srcset
. It returns None
(".item-thumb img").attr('srcset') #doesn't work
(".item-thumb img").attr.srcset #doesn't work
How to solve this? If there is no built-in way, may be a regular expression? Thanks.