I have problems with parsing HTML files. The thing is that all the examples I have seen so for are so complicated for a beginner and I don't understand them at all. I have read GetNestedTag manual but it seems that there is a better way: using HTML Dom. Let's consider the following code:
Code: Select all
; from https://autohotkey.com/board/topic/102562-parse-html-form-data-regex/
htmlCode =
(
<Form method="POST" action='http://google.com'>
<input name='test' value="abc">
<input name="test2" id="testid" value='aaa' >
<input value="345" name="w12">
<div value="xtest" name="ytest"></div><input name='bla' value='bla' class="testclass">
<input value="123">
<input type="submit" name="method1" value="white">
<input type="submit" name="method2" value="green">
</form>
)
document := ComObjCreate("HTMLFile")
document.write(htmlCode)
f := document.forms(0)
e := f.elements
t := "method:`t" f.method "`naction:`t" f.action "`n`n"
Loop % e.length
i := A_Index-1
, t .= (e[i].name!=""? e[i].name "`t" e[i].value "`n":"")
MsgBox %t%
- quit simple </span> 3272</p>
or more complicated <h1 class="articleTitle">Title of text</h1>
Any help would be much appreciated