Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2021/06/python-how-to-check-url-health-periodically-by-python-script #25

Open
utterances-bot opened this issue Jun 14, 2022 · 1 comment

Comments

@utterances-bot
Copy link

python-How to check website or url health periodically and automatically by using python script?

  1. Purpose

https://www.bswen.com/2021/06/python-how-to-check-url-health-periodically-by-python-script.html

Copy link

Many bug found:

  1. Using python3 you need to change this
    import urllib.request
    with urllib.request.urlopen(url) as response:
    html = response.read()

to this
a = = response.read()

  1. Status not "200" for example 404 result in trowing an exception that bypass the "else" statement, so script never execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants