Broken Link Checker (broken_links)
Check a website for broken links and display the number of broken links found.
Broken Link Checker
Purpose
The Broken Link Checker function helps you identify any broken links on a webpage. It checks all the links on the provided URL and returns a list of broken links along with a list of active links.
Use Cases
- Checking for broken links on a website before publishing it
- Monitoring the health of your website by regularly checking for broken links
How to Use
- Enter the URL of the webpage you want to check for broken links.
- Optionally, you can set a limit on the maximum number of URLs to check.
- Click on the "Check Links" button to start the process.
Input Values
- URL - Enter the URL of the webpage you want to check. Default unit is inch.
- Max URLs to Check - Set the maximum number of URLs to check. Default unit is 25.
Output Values
- Error - Any errors encountered during the process.
- Broken Links - List of broken links found on the webpage.
- Good Links - List of active links on the webpage.
Any Other Instructions
- Make sure to enter the correct URL to check for broken links.
- The process may take some time depending on the number of URLs to check.
Code Analysis
- The function sends a request to the provided URL.
- It retrieves all the internal and external URLs from the webpage.
- It then iterates through each URL, checking for broken links based on the HTTP response code.
- Finally, it returns the list of broken links, active links, and any errors encountered during the process.
Technical Parameters
- url, max_urls_to_check
Return Values
- Error, Broken Links, Good Links
Example Expressions
You can use the following expressions to directly evaluate in a non-interactive manner using eval():
broken_links('https://example.com', 10)
broken_links('https://anotherexample.com', 50)
Click on Help icon to open the help page on a separate window.