for url in urls:
    file_name = url.replace('www.example.com/search?q=', '').replace('=', ''
        ).replace('&', '')
file_name = re.sub('Term|Term1|Term2', '', file_name)
file_name = file_name + '.html'
print(file_name)
Strip random characters from url