Hi Guys,
I have 2 lists, one is:
But the way i have it above it's looking for the string alone, rather than if it contains the string, is there a way to do this?
cheers guys
Graham
I have 2 lists, one is:
def allowed_email_links(): """ this function keeps a list email structures we are allowed to click ... """ return ["registration.activate", "/activate/"]Which returns strings, these strings must be somewhere in a url for us to save them like:
email_extract_urls = re.findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', response[0][1].decode()) if len(email_extract_urls) > 0: if allowed_email_links() in email_extract_urls: email_container.append(email_extract_urls)What i'm trying to do is, if any of the urls in the email_extract_urls list contains a string from the allowed_email_links() list then we will add it to the email_container
But the way i have it above it's looking for the string alone, rather than if it contains the string, is there a way to do this?
cheers guys
Graham