bhargavnova / python-helper-modules

MIT License
9 stars 24 forks source link

URL Validator Python Script 🌐✅ #14

Closed bhargavnova closed 1 year ago

bhargavnova commented 1 year ago

Objective: Develop a Python script that checks if a given URL is valid and accessible. This tool will help users verify the correctness of URLs.

Features:

  1. URL Validation:

    • Implement a function to validate the format and structure of a URL.
    • for example: https://example.com -> is valid , htt://data.com -> invalid
  2. Accessibility Check:

    • Verify if the URL is reachable and returns a valid HTTP response.
  3. User-Friendly Output:

    • Provide clear feedback on the validity and accessibility of the URL.

Example Usage:

# Example usage of the URL validator script
import url_validator

url = "https://www.example.com"
is_valid, is_accessible = url_validator.validate(url)

if is_valid:
    print("The URL is valid.")

    if is_accessible:
        print("The URL is accessible.")
    else:
        print("The URL is not accessible.")
else:
    print("The URL is not valid.")

Difficulty: Beginner/Intermediate Tags: Python, URL Validation, Accessibility, HTTP Requests

Additional Information:

chankruze commented 1 year ago

I am working on it. @bhargavnova Assign it to me.

bhargavnova commented 1 year ago

Sure!!

nexuspy commented 1 year ago

can I work On this?

bhargavnova commented 1 year ago

Hi! @chankruze , I accidentally merged your request, but please remove the example folder, move that code into same .py file, and open the request again.

chankruze commented 1 year ago

Sure

bhargavnova commented 1 year ago

@nexuspy , You can find any other already open issues, or if you have anything in mind you can submit that.