tes5884 Posted July 17, 2012 Posted July 17, 2012 (edited) 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 July 17, 2012 by tes5884 www.tspitz.com
somdcomputerguy Posted July 17, 2012 Posted July 17, 2012 This function, _IETableWriteToArray, may be useful here. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
tes5884 Posted July 17, 2012 Author Posted July 17, 2012 (edited) 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 July 17, 2012 by tes5884 www.tspitz.com
DicatoroftheUSA Posted July 17, 2012 Posted July 17, 2012 (edited) #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 July 17, 2012 by DicatoroftheUSA tes5884 1 Statism is violence, Taxation is theft. Autoit Wiki
tes5884 Posted July 17, 2012 Author Posted July 17, 2012 #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!! www.tspitz.com
DicatoroftheUSA Posted July 17, 2012 Posted July 17, 2012 (edited) Your Welcome. Google isn't necessary, it should be in autoit's help file. Edited July 17, 2012 by DicatoroftheUSA tes5884 1 Statism is violence, Taxation is theft. Autoit Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now