0

I have video links in my database, but some of them broken. How can I chech these link? Now I tried this:

<iframe src="http://vidto.me/embed-7k55fuoib1p1-640x360.html" id="cart" style="height:1000px" width="100%" frameBorder="0" ></iframe>
<script>
// set onload on element
document.getElementById('cart').onload = function() {
alert('Frame element loaded')
  }
</script>

If I change the video ID in the src, the site gives "Not found". But my script gives 'Frame element loaded' too. How can I check my links live or broken?

  • If a page is not found, basically a 404 page is loaded. So what you could do, after the page has loaded, to check if a specific element exists on the page. – rolfv1 Feb 10 '18 at 15:01

1 Answers1

0

You can use wget search your site for broken links

wget --spider -r -nd -nv -H -l 1 -w 2 http://example.com

Jacob
  • 77
  • 7