import requests

def check_website_status(url):
    try:
        response = requests.get(url)
        if response.status_code == 200:
            return "Website is up and running."
        else:
            return f"Website is down with status code {response.status_code}."
    except requests.ConnectionError:
        return "Could not connect to the website."

# Example usage:
url = "https://www.example.com"
status = check_website_status(url)
print(status)

이 스크립트는 함수를 정의합니다 check_website_status URL을 입력으로 사용하고 웹사이트가 작동 중인지 작동 중지되었는지를 나타내는 메시지를 반환합니다. 교체할 수 있습니다 "https://www.example.com" 확인하고 싶은 웹사이트의 URL을 입력하세요.

댓글 (0)

여기에는 아직 댓글이 없습니다. 첫 번째 댓글이 되실 수 있습니다!

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다


프록시 선택 및 구매

데이터센터 프록시

회전 프록시

UDP 프록시

전 세계 10,000명 이상의 고객이 신뢰함

대리 고객
대리 고객
대리 고객 flowch.ai
대리 고객
대리 고객
대리 고객