Mar-13-2019, 08:05 AM
Hi Guys,
I am not too sure on the best way to solve this, i have some basic code:
thank you for any help guys!
Graham
I am not too sure on the best way to solve this, i have some basic code:
# search for any of these strings search_for = ['about me', 'home page'] # function - send a get request to each url def send_get_request(link, search_for): try: html = requests.get(link) except requests.exceptions.RequestException as e: print("Error: {}" . format(e)) if re.findall('|'.join(search_for), html.text.lower()): return link else: return FalseThe strings ion search_for if they are found in the html, it's a success, but i have noticed it only reads the first word for example: if it finds about it will flag it as a success, instead of reading the whole word which would be: about me is there a way to solve this? i assumed it would read the whole word but it seems not to.
thank you for any help guys!
Graham