Code: Select all
ignored =
(
;list of my ignored tags
)
objIgnored := {}
Loop, parse, ignored, `n, `r
objIgnored[A_LoopField] := ""
url := "https://math.stackexchange.com/questions"
Whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
Whr.Open("GET", url, false)
Whr.Send()
status := Whr.status
if (status != 200)
throw "HttpRequest error, status: " . status
Arr := Whr.responseBody
pData := NumGet(ComObjValue(arr) + 8 + A_PtrSize)
length := arr.MaxIndex() + 1
html := StrGet(pData, length, "UTF-8")
Doc := ComObjCreate("htmlfile")
Doc.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
Doc.write(html)
summary := Doc.querySelectorAll("div.summary")
links := ""
Loop % summary.length {
tags := summary[A_Index - 1].querySelectorAll("div.tags > a.post-tag")
Loop % tags.length
if objIgnored.HasKey( tags[A_Index - 1].innerText )
continue 2
Run, % link := StrReplace(summary[A_Index - 1].querySelector("a.question-hyperlink").href, "about:", "https://math.stackexchange.com",, 1)
links .= link . "`n"
}
MsgBox, 4096,, % links ; this line to check which links were found and opened
Return
Is it possible to add some line of codes to the above script in order to show all the comments below each question and answers automatically? (Doing this will help me a lot because I am opening all questions then go disconnect and read them offline.)
Thanks in advanced