soup.findAll('img', 'текст для поиска').replace('текст для поиска', 'текст на замену')
from bs4 import BeautifulSoup
html = '''
<body>
<img src="https://yandex.com/main.jpg">
</body>
'''
soup = BeautifulSoup(html,'html.parser')
tag = soup.img
tag['src'] = 'https://google.com/main.jpg'
print(soup)
<body>
<img src="https://google.com/main.jpg"/>
</body>