Code: Select all
;example webpages for testing script:
;List of countries and dependencies by population - Wikipedia
;https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population
;Variables and Expressions
;https://autohotkey.com/docs/Variables.htm#BuiltIn
;[WBGet function]
;WBGet function - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=39869
q:: ;html tables - get text
WinGet, hWnd, ID, A
oWB := WBGet("ahk_id " hWnd)
;if AutoHotkey help, get IFrame
;MsgBox, % oWB.document.parentWindow.frames.length
if InStr(oWB.document.url, "://autohotkey.com/docs")
{
vNum := 0
;IID_IHTMLWindow2 := "{332C4427-26CB-11D0-B483-00C04FD90119}"
oWB := ComObject(9, ComObjQuery(oWB.document.parentWindow.frames[vNum], "{332C4427-26CB-11D0-B483-00C04FD90119}", "{332C4427-26CB-11D0-B483-00C04FD90119}"), 1)
}
;MsgBox, % oWB.document.all.length
oTables := oWB.document.getElementsByTagName("table")
Loop, % oTables.length
{
oTable := oTables[A_Index-1]
oRows := oTable.rows
vOutput := ""
Loop, % oRows.length
{
vOutput .= (A_Index=1?"":"`r`n")
oCells := oRows[A_Index-1].cells
Loop, % oCells.length
vOutput .= (A_Index=1?"":"`t") oCells[A_Index-1].innerText
}
;Clipboard := vOutput "`r`n"
MsgBox, % vOutput
}
oWB := oTables := oTable := oRows := oCells := ""
MsgBox, % "done"
return
Internet Explorer get element under cursor (show borders, show text) (any zoom percentage) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=29458
Simple HTML Table Parse - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 68#p178768
webpages: get icon urls - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=38936