Hi everyone! I'm relatively new to AHK but am somewhat familiar with the concept.
I'm looking for how do extract a variable from HTML data to define my own variable. I know where the variable is in the HTML code, just not how to extract it.
Pulling a Variable from HTML code
Re: Pulling a Variable from HTML code
To clarify further, I'm trying to pull a variable from whatever site I'm typing the hotkey in, not a static website.
Re: Pulling a Variable from HTML code
I guess the HTML code does not change much and you know the words before and after your variable data
This is a code I use a lot:
Sorry, the variable names are in Spanish
This is a code I use a lot:
Sorry, the variable names are in Spanish
Code: Select all
Try
{
; Get all the HTML in a variable
Texto := GetHTTP(Página)
; find the text
Desde := "Version "
Hasta := " Download size"
Versión := RegExReplace(Texto, "s).+" . Desde . "(.+?)" . Hasta . ".+", "$1")
Versión := ComponerVersion(Versión)
} Catch e
Versión := "Timeout"
MsgBox % Versión
Re: Pulling a Variable from HTML code
Thanks for the code! Is there any chance you could quickly explain what each line is doing? Doesn't have to be super in-depth.