javascript - Script to check for keyword on website -
i want write script goes trough list of url's checking wheter valid or not.
the page not redirect 404 rather displays sentence 'sorry, not found! if url invalid.
so if script finds sentence, url invalid. if not should valid.
any idea on how realize in js? pointers possible methods in other languages welcome too!
thanks!
a simple python way be:
import requests urls = ['https://www.google.com'] # fill url in urls: resp = requests.get(url) if 'sorry, not found!' in resp.text: print(url + ' had no page') # or
Comments
Post a Comment