![]() |
Writing values to Web Forms
All:
Is it possible to write values, using VB, to a web form in IE? Thanks, Brian A Lopez |
Writing values to Web Forms
Hi Brian,
Yes, but it takes a bit of doing. Check out the following thread to get some ideas. If you need more assistance, please post back with what URL you're trying to post data to. http://groups.google.com/groups?hl=e...%40tkmsftngp07 (watch for URL wrap) -- Regards, Jake Marx www.longhead.com Brian Lopez wrote: All: Is it possible to write values, using VB, to a web form in IE? Thanks, Brian A Lopez |
Writing values to Web Forms
I guess my attempt is extremely complicated.
In the login screen example, I would like to read the text to the left of the combobox and the enter the appropriate values before I would click on signon. Is this even possible, does IE cooperate with VB? -----Original Message----- Hi Brian, Yes, but it takes a bit of doing. Check out the following thread to get some ideas. If you need more assistance, please post back with what URL you're trying to post data to. http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF- 8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07 (watch for URL wrap) -- Regards, Jake Marx www.longhead.com Brian Lopez wrote: All: Is it possible to write values, using VB, to a web form in IE? Thanks, Brian A Lopez . |
Writing values to Web Forms
Hi Brian,
Yes, you can do this. If the text is within a named HTML element (if the element has id="foo" or name="foo" in the tag), it is easier to get via the GetElementByID or GetElementByName, which are methods of the Document or Body object, I think. If not, you'll have to search the whole body for it using Document.Body.InnerText or InnerHTML to get the text or source of the document body. So the process would go: 1) navigate to the signon page, 2) read the value you need using one of the methods above, 3) post the form data to the signon processing page (the action attribute of the form element), then hopefully you'll be logged in. If you continue to have problems, please post the URL, and I'd be happy to help you further. -- Regards, Jake Marx www.longhead.com Brian A lopez wrote: I guess my attempt is extremely complicated. In the login screen example, I would like to read the text to the left of the combobox and the enter the appropriate values before I would click on signon. Is this even possible, does IE cooperate with VB? -----Original Message----- Hi Brian, Yes, but it takes a bit of doing. Check out the following thread to get some ideas. If you need more assistance, please post back with what URL you're trying to post data to. http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF- 8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07 (watch for URL wrap) -- Regards, Jake Marx www.longhead.com Brian Lopez wrote: All: Is it possible to write values, using VB, to a web form in IE? Thanks, Brian A Lopez . |
Writing values to Web Forms
"Jake Marx" wrote in message ...
I'm working on a similar problem and having some difficulty. Two things: First when I execute this line of code having previously created the IE object and made it visible oInt.Navigate sURL, 0, " self", bytePost, sHeader I get a second IE window. I've played with " self" trying "_SELF", "_self", etc. to no effect. What am I missing? Second, the form looks like this: <form name="content" method="post" <input type="hidden" size="-1" name="form_validate" value="1" <input type="hidden" size="-1" name="cid" <input type="hidden" size="-1" name="cntid" <input type="hidden" size="-1" name="attid" I'm sending through a post of form_validate=1&cid=4343&cntid=&attid= that is converted by bytePost = StrConv(bytePostData, vbFromUnicode) and a header of sHeader = "Content-Type: " & _ "application/x-www-form-urlencoded" & vbCrLf Unfortunately, I do not get the expected page. Any clues? Thanks, Richard Hi Brian, Yes, you can do this. If the text is within a named HTML element (if the element has id="foo" or name="foo" in the tag), it is easier to get via the GetElementByID or GetElementByName, which are methods of the Document or Body object, I think. If not, you'll have to search the whole body for it using Document.Body.InnerText or InnerHTML to get the text or source of the document body. So the process would go: 1) navigate to the signon page, 2) read the value you need using one of the methods above, 3) post the form data to the signon processing page (the action attribute of the form element), then hopefully you'll be logged in. If you continue to have problems, please post the URL, and I'd be happy to help you further. -- Regards, Jake Marx www.longhead.com Brian A lopez wrote: I guess my attempt is extremely complicated. In the login screen example, I would like to read the text to the left of the combobox and the enter the appropriate values before I would click on signon. Is this even possible, does IE cooperate with VB? -----Original Message----- Hi Brian, Yes, but it takes a bit of doing. Check out the following thread to get some ideas. If you need more assistance, please post back with what URL you're trying to post data to. http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF- 8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07 (watch for URL wrap) -- Regards, Jake Marx www.longhead.com Brian Lopez wrote: All: Is it possible to write values, using VB, to a web form in IE? Thanks, Brian A Lopez . |
All times are GMT +1. The time now is 05:43 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com