I need to convert a group of variables (result sets from BeautifulSoup) into strings. Is there an elegant way to do this to all of them at once instead of one by one? I was thinking something like this -
for name in [company_name, company_address, company_logo, company_cat, company_lat, company_phone, company_fax]:
name = str(name)
I would also like to do a similar thing with re.sub -
for name in [company_name, company_address, company_logo, company_cat, company_lat, company_phone, company_fax]:
re.sub('<[^<]+?>', '', name)
Thanks