JeffJones Posted March 22, 2007 Posted March 22, 2007 Hi there,I am fairly new to scripting so maybe this is a more basic question, but I have been able to successfully manipulate many other websites. This one is giving me trouble: https://www.putnam.com/individual/ I would like to have my code enter in a ssn and password and login to this website. Can someone please take a look and tell me how to reach the form, I think its name is "login". Thanks - Jeff
flyingboz Posted March 22, 2007 Posted March 22, 2007 Hi there,I am fairly new to scripting so maybe this is a more basic question, but I have been able to successfully manipulate many other websites. This one is giving me trouble: https://www.putnam.com/individual/Look for framesets -- use a browser like firefox or maxthon that has a more robust "View Source" capability, or install Fiddler for IE. Someone has recommended a DOM Inspector tool (plugin for firefox?) that would likely show you exactly what you need to know.Or, you can get access to the frame collection object, and enumberate it until it gives up its secrets. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
JeffJones Posted March 23, 2007 Author Posted March 23, 2007 Look for framesets -- use a browser like firefox or maxthon that has a more robust "View Source" capability, or install Fiddler for IE. Someone has recommended a DOM Inspector tool (plugin for firefox?) that would likely show you exactly what you need to know.Or, you can get access to the frame collection object, and enumberate it until it gives up its secrets.Thanks for the advice... I looked at the "view source" in a firefox window as opposed to internet explorer and it looked much different. There is one frame on this website, "EfsPortalFrameset" and I tried to view all of its elements but I couldnt get any... So I am still a little lost. I looked into your Fiddler thing, and don't think that I want to try to understand that, it looks like it's more of a logging tool than anything. Thanks again - Jeff
MrTWist Posted March 23, 2007 Posted March 23, 2007 Yes, Fiddler is a HTTP/HTTPS monitoring tool. It lets you see the raw HTTP traffic on port 80. It would be a pain in the neck to seperate the code from the request/response headers.A DOM inspector would probably be optimal for this situation. The IE Developer Toolbar is a toolbar (duh...) for IE (double duh...) that would let you home right in on the section of code you want to pick apart. You can find it here:http://www.microsoft.com/downloads/details...;displaylang=en;~ AutoIt rules
Hasher Posted March 23, 2007 Posted March 23, 2007 (edited) Hi I am having trouble hooking these objects too . This is the code I got so far #include <IE.au3> $oIE = _IECreate("https://www.putnam.com/individual/") $oFrame = _IEFrameGetObjByName ($oIE, "EfsPortalFrameset") $form = _IEFormGetCollection($oFrame,"login") $login = _IEFormGetObjByName($form,"logon") $pass = _IEFormGetObjByName($form,"password") _IEFormElementSetValue($login,"name") _IEFormElementSetValue($pass,"pass") THe Dom of each item is: document.all.EfsPortalFrameset.all.ACMEBottom.forms.login.logon document.all.EfsPortalFrameset.all.ACMEBottom.forms.login.password So logon and password are the textbox's contained in the frameset of EfsPortalFrameset..... but not sure what ACMEBottom is.. Edited March 23, 2007 by Hasher Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!
JeffJones Posted March 23, 2007 Author Posted March 23, 2007 Hi I am having trouble hooking these objects too . This is the code I got so far #include <IE.au3> $oIE = _IECreate("https://www.putnam.com/individual/") $oFrame = _IEFrameGetObjByName ($oIE, "EfsPortalFrameset") $form = _IEFormGetCollection($oFrame,"login") $login = _IEFormGetObjByName($form,"logon") $pass = _IEFormGetObjByName($form,"password") _IEFormElementSetValue($login,"name") _IEFormElementSetValue($pass,"pass") THe Dom of each item is: document.all.EfsPortalFrameset.all.ACMEBottom.forms.login.logon document.all.EfsPortalFrameset.all.ACMEBottom.forms.login.password So logon and password are the textbox's contained in the frameset of EfsPortalFrameset..... but not sure what ACMEBottom is.. Hi, Thanks everyone for your replies, we are definitely getting closer, still have yet to get the code exactly right to put something in those fields... I have tried similar code to what you have above, and I am almost positive that the: $oFrame = _IEFrameGetObjByName ($oIE, "EfsPortalFrameset") line of code executes properly, but I don't think you can skip down and set the form in your next statement because in between there's that "ACMEBottom" frame... I tried other lines of code like: $oFram = _IEFrameGetObjByName ($oFrame, "ACMEBottom") and got errors... Any more help would be greatly appreciated P.S. That DOM toolbar thing for IE is really helpful, thanks!
jinxter Posted March 23, 2007 Posted March 23, 2007 Web developer for firefox is quite nice aswell, since I don't use IE. > there are 10 types of people in the world, those who understand binary and those who don't.
JeffJones Posted March 23, 2007 Author Posted March 23, 2007 Web developer for firefox is quite nice aswell, since I don't use IE.Is there anyone out there who can give me a few lines of code that can put something in these fields?!!? Thanks
zasxes Posted April 15, 2007 Posted April 15, 2007 This may not be the best way but it worked for me #include <IE.au3> Global $oIE Global $AFrames Global $CountFrames Global $AFrame Global $BFrames Global $BFrame $oIE = _IECreate("https://www.putnam.com/individual/") $AFrames = _IEFrameGetCollection ($oIE) $CountFrames = @extended MsgBox(0, "FramesA " & $CountFrames, "see above") For $i = 0 to ($CountFrames - 1) $AFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Info for Frame " & $i, _IEPropertyGet ( $AFrame, "locationurl")) Next $BFrames = _IEFrameGetCollection ($AFrame) $CountFrames = @extended MsgBox(0, "FramesB " & $CountFrames, "see above") For $i = 0 to ($CountFrames - 1) $BFrame = _IEFrameGetCollection ($AFrame, $i) MsgBox(0, "Frame Info for Frame " & $i, _IEPropertyGet ( $BFrame, "locationurl")) Next ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $MainFrame = _IEFrameGetCollection ($oIE, 0) $UpperFrame = _IEFrameGetCollection ($AFrame, 0) $LowerFrame = _IEFrameGetCollection ($AFrame, 1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $oTable = _IETableGetCollection ($LowerFrame) $iNumTables = @extended MsgBox(0, "Table Info", "There are " & $iNumTables & " tables on the page") $oForm = _IEFormGetObjByName ($LowerFrame, "login") $Uid = "111111" $oQuery = _IEFormElementGetObjByName ($oForm, "logon") _IEFormElementSetValue ($oQuery, $Uid)
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