Code: Select all
FileRead, html, savedpage.html
document := ComObjCreate("HTMLfile")
document.write(html)
MyTitle := document.getElementsByClassName("product-name")[0].innerText
MsgBox, %MyTitle%
ExitApp
Code: Select all
FileRead, html, savedpage.html
document := ComObjCreate("HTMLfile")
document.write(html)
MyTitle := document.getElementsByClassName("product-name")[0].innerText
MsgBox, %MyTitle%
ExitApp
i think Shell.Explorer work like Web Driver. FileRead, html, not.microtorrent135 wrote:I am trying to retrieve some information from a html file but couldn't. It works fine when I use it in online webpage but fails for html files. Did I miss anything?
How to do that? Could you help me by an example?masheen wrote:i think Shell.Explorer work like Web Driver. FileRead, html, not.microtorrent135 wrote:I am trying to retrieve some information from a html file but couldn't. It works fine when I use it in online webpage but fails for html files. Did I miss anything?
Code: Select all
;[WBGet]
;Basic Webpage Controls with JavaScript / COM - Tutorial - Tutorials - AutoHotkey Community
;https://autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/
q:: ;check IE / HTMLFile version number
WinGet, hWnd, ID, ahk_class IEFrame
oWB := WBGet("ahk_id " hWnd)
MsgBox % oWB.document.documentMode ;11.000000
oWB := ""
oHTML := ComObjCreate("HTMLFile")
oHTML.write("")
MsgBox % oHTML.documentMode ;5.000000
oHTML := ""
oHTML := ComObjCreate("HTMLFile")
vHtml = <meta http-equiv="X-UA-Compatible" content="IE=edge">
oHTML.write(vHtml)
MsgBox % oHTML.documentMode ;11.000000
oHTML := ""
Users browsing this forum: AHKStudent, Chunjee, LeFunk, RaZorwiresc2, Xtra and 56 guests