Test if an attribute is present in a tag in BeautifulSoup,tags = soup.find_all(lambda tag: tag.has_attr('src'))