소켓에 연결하고 .read()를 사용하여 응답을 캡처 한 후 입력 스트림을 구문 분석하고 회선을 읽는 방법은 무엇입니까?httplib을 사용하여 파이썬 응답 구문 분석
나는 데이터가 어떤 CRLF
<html><head><title>Apache Tomcat/6.0.16 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /index.html</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/index.html</u></p><p><b>description</b> <u>The requested resource (/index.html) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.22</h3></body></html>
코드를 보여주세요! – ghostdog74
그리고 구문 분석을 원하십니까? – ghostdog74
아마도 출력이 오류 메시지 인 것 같아서 read()가 제대로 작동하지 않을 수도 있습니다. –