AutoHotKey

ahk_l 웹페이지 파일로 저장한 뒤 불러와 필요한 부분 추출하여 출력하기

by 디케 posted Feb 22, 2011
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

ahk_l 웹페이지 파일로 저장한 뒤 불러와 필요한 부분 추출하여 출력하기

http://www.autohotkey.com/forum/viewtopic.php?p=378141#378141

; download the webpage source
URLDownloadToFile, http://www.google.com, Google_HTML
FileRead, html, Google_HTML
FileDelete, Google_HTML

; write the Google Source to an HTMLfile
doc := ComObjCreate("HTMLfile")
doc.write(html)

; loop through all the links
links := doc.links
Loop, % links.length 
   n := A_Index-1
   , list .= n ") " links[n].innerText "`n"
   . "URL: " links[n].href "`n`n"

; some URLs have "about:" rather than the domain
StringReplace, list, list, about:, http://www.google.com, All

MsgBox, %list%


Articles

1 2 3 4 5