HTML 문서 내용을 읽어 오려는데 막혀있습니다..
글쓴이: 망치 / 작성시간: 수, 2006/02/01 - 11:01오전
http://www.livescore.com/default.dll?page=home
위 페이지에 공개되있는 정보를 주기적으로 읽어오고 싶은데 이래저래 막아놨더군요. wget 이나 php 소켓을 이용해 읽어오거나 해봤는데 실패했습니다..
좋은 수 없을까요? :?
File attachments:
첨부 | 파일 크기 |
---|---|
![]() | 20.37 KB |
Forums:
파이썬이나 자바로 웹페이지의 HTML을 읽어올수 있는데,그것도 막아놓
파이썬이나 자바로 웹페이지의 HTML을 읽어올수 있는데,
그것도 막아놓은건가요?
python
----------------------------------------
wget "http://www.libescore.com/default.d
wget "http://www.libescore.com/default.dll/stop?page=home&sid=0602Gu" --referer="http://www.livescore.com/default.dll?page=home" --user-agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
referer와 user agent를 변조하시면 wget로도 가능합니다.
다운로드할 URL을 알기 위한 단계가 한 단계 더 필요하겠지만요.
그리 어려워 보이지는 안는데
한번더 해보시길...익스로 볼수 있으면 대부분 긁어오는거 가능합니다.
쿠키나 리퍼러 에이전트 좀 신경써서 체크해 보세요.
wget 으로 다시 시도해봤는데 역시 마찬가지입니다..curl 이용해
wget 으로 다시 시도해봤는데 역시 마찬가지입니다..
curl 이용해서 한번 시도해봐야겠습니다.
---------------------------------------
http://www.waitfor.com/
http://www.textmud.com/
w3m을 이용해서...
w3m -dump http://www.livescore.com/default.dll?page=home
w3m -dump_both http://www.livescore.com/default.dll?page=home > hmm
을 해서,
hmm파일을 보니,
Content-Encoding: deflate라고 하는군요.
과자가 아닙니다.
cuckoo dozen, 즉.12마리의 뻐꾸기란 뜻입니다.
대충 살펴보니..php 로 하더라도 몇단계 거쳐야 할 듯 합니다.
대충 살펴보니..
php 로 하더라도 몇단계 거쳐야 할 듯 합니다.
마치 브라우저가 하듯이 말이죠.
저의 예를 들어보면(쿠키는 계속 변할듯. 아래에서 화살표 다음이 서버로부터의 응답임.)
1. GET /default.dll?page=home
-->
HTTP/1.1 200 OK
<body bgcolor="#000000" onLoad="JavaScript:document.check.submit();"><form name="check" method="post" action="/default.dll?page=home"><input type="hidden" name="sid" value="0602Hu"></form></body></html>
2. 위의 응답에 대해
POST /default.dll?page=home HTTP/1.1
Referer: http://www.livescore.com/default.dll?page=home
Cookie: SID0602=0602Hu
Content-Type: application/x-www-form-urlencoded
Content-Length: 10
sid=0602Hu
-->
HTTP/1.1 100 Continue
HTTP/1.1 302 Moved Temporarily
Set-Cookie: SID0602=0602Hu116; path=/; expires=Sun, 05 Mar 2006 05:37:35 GMT
Location: /default.dll?page=home
3. 위의 서버응답에 대해
GET /default.dll?page=home HTTP/1.1
Host: www.livescore.com
Referer: http://www.livescore.com/default.dll?page=home
Cookie: SID0602=0602Hu116
-->
HTTP/1.1 200 OK
Content-Length: 49904
<!DOCTYPE HTML ..어쩌구저쩌구..
blacknue 님 감사.. 힌트덕에 해결했습니다.
blacknue 님 감사.. 힌트덕에 해결했습니다.
---------------------------------------
http://www.waitfor.com/
http://www.textmud.com/
댓글 달기