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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -