except:
username = ""
link_to_profile = ""
social_media = ""
except Exception as err:
print('Ошибка при обработке', map_url)
print(err)
username = ""
link_to_profile = ""
social_media = ""
s = 'a,100,150,200'
print(f(s)) # в f() передаётся строка!
lines = []
...
for product in f(lines): # в f() передаётся список строк!
...
Но как минимум, ты не учёл параметр anchor.