- 전체
- Python 일반
- Python 수학
- Python 그래픽
- Python 자료구조
- Python 인공지능
- Python 인터넷
- Python SAGE
- wxPython
- TkInter
- iPython
- wxPython
- pyQT
- Jython
- django
- flask
- blender python scripting
- python for minecraft
- Python 데이터 분석
- Python RPA
- cython
- PyCharm
- pySide
- kivy (python)
Python 인터넷 python 활용 웹 사이트가 존재하는지 체크 : Python check if website exists
2018.01.16 16:45
python 활용 웹 사이트가 존재하는지 체크 :
Python check if website exists
You can use HEAD request instead of GET. It will only download the header, but not the content. Then you can check the response status from the headers.
import httplib
c = httplib.HTTPConnection('www.example.com')
c.request("HEAD", '')
if c.getresponse().status == 200:
print('web site exists')
or you can use urllib2
import urllib2
try:
urllib2.urlopen('http://www.example.com/some_page')
except urllib2.HTTPError, e:
print(e.code)
except urllib2.URLError, e:
print(e.args)
or you can use requests
import requests
request = requests.get('http://www.example.com')
if request.status_code == 200:
print('Web site exists')
else:
print('Web site does not exist')
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 10 |
[python, tkinter] [python/GUI] tkinter 로 GUI 만들기(기초예제, 단위 변환기 만들기)
| 졸리운_곰 | 2023.03.07 | 326 |
| 9 |
Rapyd-Tk : An open-source application development environment for Python/Tkinter
| 졸리운_곰 | 2017.01.07 | 1440 |
| 8 |
Tkinter로 하는 GUI 프로그래밍
| 졸리운_곰 | 2015.05.12 | 1628 |
| 7 | python 2.X 와 python 3.X 의 tkinter 코드 호환 유지 기법 : from Tkinter import * 에러시 | 졸리운_곰 | 2014.11.03 | 1769 |
| 6 | Tkinter Summary [Tkinter 요약] | 졸리운_곰 | 2014.10.14 | 3203 |
| 5 | An Introduction To Tkinter TkInter에 대한 소개 | 졸리운_곰 | 2014.10.14 | 2649 |
| 4 |
tkinter_nmt.pdf
| 졸리운_곰 | 2014.10.14 | 6234 |
| 3 |
tkinter.pdf
| 졸리운_곰 | 2014.10.14 | 6858 |
| 2 |
tkinter-python-intro.pdf
| 졸리운_곰 | 2014.10.14 | 7646 |
| 1 |
python-and-tkinter-programming.pdf
| 졸리운_곰 | 2014.10.14 | 7918 |

