<div class="article__main-photo-img" style="background-image: url('https://example.ru/ufiles/pics/img-1234-1234567.jpg')"></div>
from bs4 import BeautifulSoup
html_doc = """
<div class="article__main-photo-img" style="background-image: url('https://example.ru/ufiles/pics/img-1234-1234567.jpg')"></div
"""
soup = BeautifulSoup(html_doc, 'lxml')
div = str(soup.select('.article__main-photo-img')[0])
link = div.split('url(')[1][:-9]
print(link)