Jump to content

Recommended Posts

Posted (edited)

Hi 

 

I'd like to write a script to test for broken links with a webpage looking like this

image.png.57e2a431ade8dac5ce454b7be9aba23a.png

I could just click into each link using the xpath and check the page there. That also seems a bit too specific. What if you just want to check if a webpage has any broken links? without knowing the xpaths? 

I'm wondering if there is already a script to test a webpages links and check if they are broken though? 

If not, how can I Retrieve all links on a webpage as I guess that's where I should start 

 

 

Thanks!

Edited by CaptainBeardsEyesBeard
Posted (edited)

maybe like this:

;~ https://www.autoitscript.com/forum/topic/209156-webdriver-testing-broken-links
#include <InetConstants.au3>                                 ; added:11/11/22 21:48:55
#include <MsgBoxConstants.au3>                               ; added:11/11/22 21:49:18

_Example()

Func _Example()
    If Not InetGetSize("http://testingxgch.co.uk", $INET_FORCERELOAD) Then
        MsgBox($MB_OK + $MB_TOPMOST + $MB_ICONINFORMATION, "Information", "WRONG LINK")
    EndIf
EndFunc   ;==>_Example

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...