Jump to content
Sign in to follow this  
karose

How to using StringRegExp with _IEDocReadHTML

Recommended Posts

karose

#include <IE.au3>
#include <Array,au3>
$oIE = _IECreate ("192.168.1.100")
$sHTML = _IEDocReadHTML ($oIE)
$sessionID = StringRegExp ($sHTML, "sessionID=(.*)\&action,3)
Msgbox (0, "sessionID", $sessionID[0])

I'd like to get sessionID from HTML source, but cause "Subscript used with non-Array variable.:" with &sessionID[0]

It works fine if set $sHTML to "version1.0&sessionID=224522&action=get"

Share this post


Link to post
Share on other sites
oMBRa

try this:

#include <IE.au3>
#include <Array,au3>
$oIE = _IECreate ("192.168.1.100")
$sHTML = _IEDocReadHTML ($oIE)
$sessionID = StringRegExp ($sHTML, "sessionID=(.*?)&action",3)
Msgbox (0, "sessionID", $sessionID[0])

you dont have to escape "&"

Share this post


Link to post
Share on other sites
karose

try this:

#include <IE.au3>
#include <Array,au3>
$oIE = _IECreate ("192.168.1.100")
$sHTML = _IEDocReadHTML ($oIE)
$sessionID = StringRegExp ($sHTML, "sessionID=(.*?)&action",3)
Msgbox (0, "sessionID", $sessionID[0])

you dont have to escape "&"

Thanks, it works !!!! :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.