I have returned a list of href values from a HTML document. I want to go though every link within this list and test to see if they contain any of the values within my IMAGE_FORMAT tuple.
IMAGE_FORMAT = (
'.png',
'.jpg',
'.jpeg',
'.gif',
)
At present I am simply testing for '.jpg' e.g if '.jpg' in link.get('href'):
I'd like to extend this code to something along the lines of if [any value inside IMAGEFORMAT] in link.get('href'):
What would be the most efficient or cleanest way or doing so?