Jump to content
Sign in to follow this  
tes5884

Extract specific field from IE page

Recommended Posts

tes5884

Hi guys,

I'm trying to create a script that goes to

http://www8.tax.ny.gov/UTLR/utlrHome
enters information, then assigns the "Jurisdiction Code" to a variable.

My understanding is, the Jurisdiction Code is in a table. However, I can't figure out how to extract it.

I looked into:

_IETableGetCollection
_IETableWriteToArray

But couldn't figure it out.

Can anyone point me in the right direction?

Below is my current code.

Thanks!

#include <Excel.au3>
#include <IE.au3>
#include <Array.au3>

$oIE = _IECreate()
_IENavigate($oIE, "http://www8.tax.ny.gov/UTLR/utlrHome")

$o_form = _IEFormGetObjByName($oIE, "UTLRForm")
$o_addr = _IEFormElementGetObjByName($o_form, "UTLR_STREETADDRESS_KEY")
$o_zip = _IEFormElementGetObjByName($o_form, "UTLR_ZIPCODE_KEY")
$o_type = _IEFormElementGetObjByName($o_form, "UTLR_SERVICETYPE_KEY")


_IEFormElementSetValue($o_addr, "136 Maple Avenue")
_IEFormElementSetValue($o_zip, "10952")
_IEFormElementSetValue($o_type, "Residential energy services")
_IEFormSubmit($o_form)
Edited by tes5884

Share this post


Link to post
Share on other sites
tes5884

This function, _IETableWriteToArray, may be useful here.

When I tried that, ArrayDisplay only showed 2 tables, it never got down to the table I actually need.

Also, assuming I got to the right table, how do I select the specific cell/s.

$oTable=_IETableGetCollection($oIE,1)

$aTableData=_IETableWriteToArray($oTable,True)

_ArrayDisplay($aTableData)

Thanks taking the time to help me!

Edited by tes5884

Share this post


Link to post
Share on other sites
DicatoroftheUSA

#include <Excel.au3>
#include <IE.au3>
#include <Array.au3>

$oIE = _IECreate()
_IENavigate($oIE, "http://www8.tax.ny.gov/UTLR/utlrHome")

$o_form = _IEFormGetObjByName($oIE, "UTLRForm")
$o_addr = _IEFormElementGetObjByName($o_form, "UTLR_STREETADDRESS_KEY")
$o_zip = _IEFormElementGetObjByName($o_form, "UTLR_ZIPCODE_KEY")
$o_type = _IEFormElementGetObjByName($o_form, "UTLR_SERVICETYPE_KEY")


_IEFormElementSetValue($o_addr, "136 Maple Avenue")
_IEFormElementSetValue($o_zip, "10952")
_IEFormElementSetValue($o_type, "Residential energy services")
_IEFormSubmit($o_form)

$aJurisdictionCodes=StringRegExp(_IEBodyReadText ( $oIE ),'Jurisdiction code:(.*)',3)
_ArrayDisplay($aJurisdictionCodes)

Edited by DicatoroftheUSA
  • Like 1

Share this post


Link to post
Share on other sites
tes5884

#include <Excel.au3>
#include <IE.au3>
#include <Array.au3>

$oIE = _IECreate()
_IENavigate($oIE, "http://www8.tax.ny.gov/UTLR/utlrHome")

$o_form = _IEFormGetObjByName($oIE, "UTLRForm")
$o_addr = _IEFormElementGetObjByName($o_form, "UTLR_STREETADDRESS_KEY")
$o_zip = _IEFormElementGetObjByName($o_form, "UTLR_ZIPCODE_KEY")
$o_type = _IEFormElementGetObjByName($o_form, "UTLR_SERVICETYPE_KEY")


_IEFormElementSetValue($o_addr, "136 Maple Avenue")
_IEFormElementSetValue($o_zip, "10952")
_IEFormElementSetValue($o_type, "Residential energy services")
_IEFormSubmit($o_form)

$aJurisdictionCodes=StringRegExp(_IEBodyReadText ( $oIE ),'Jurisdiction code:(.*)',3)
_ArrayDisplay($aJurisdictionCodes)

Thank you DicatoroftheUSA.

I need to do some google'ing, so I can understand what you just did. But, that seems to work!!

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.