Найти - Пользователи
Полная версия: убрать из html alt="text"
Начало » Python для новичков » убрать из html alt="text"
1
gelius
Долго гуглю.
html = html.replace('alt=\"','')
Убирает все alt="
А так:
html = html.replace('alt=\"(.*?)\"','')
не хочет.
Опробованы все пришедшие в голову варианты
ajib6ept
replace не поддерживает regexp, для работы с ними надо использовать модуль re

dimy44
re.sub(r'alt="[^"]*"', '', html)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB