Script to get the HTTP status code of a list of urls?

前端 未结 8 869
无人及你
无人及你 2020-11-30 17:17

I have a list of URLS that I need to check, to see if they still work or not. I would like to write a bash script that does that for me.

I only need the returned HTT

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 17:49

    I found a tool "webchk” written in Python. Returns a status code for a list of urls. https://pypi.org/project/webchk/

    Output looks like this:

    ▶ webchk -i ./dxieu.txt | grep '200'
    http://salesforce-case-status.dxi.eu/login ... 200 OK (0.108)
    https://support.dxi.eu/hc/en-gb ... 200 OK (0.389)
    https://support.dxi.eu/hc/en-gb ... 200 OK (0.401)
    

    Hope that helps!

提交回复
热议问题