[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Submitting a form navigated to using WebBrowser control

Posted on 2008-11-11
1
Medium Priority
?
249 Views
Last Modified: 2013-12-17
I am doing the old screen scraping technique to automate the manual retrieval of data some of our people do daily. I have the logon and password being entered in the the textboxes on the screen - but the submit button is an image which has no name or id property. I don't see any way I can click that button for them.  Is there a way to submit that form without clicking the image?  
0
Comment
Question by:CreditSoupTech
1 Comment
 
LVL 4

Accepted Solution

by:
CreditSoupTech earned 0 total points
ID: 22932647
Found the answer myself.  The form had no name specified so I had to loop through all the elements till I found FORM.  Luckily the other two forms on this page did have names.  



 HtmlDocument doc = webBrowser1.Document;
                elems = doc.All.GetElementsByName("");

                if (elems != null && elems.Count > 0)
                    for (int i = 0; i < elems.Count; i++)
                    {

                        {
                            elem = elems[i];
                            if (elem.TagName.Equals("FORM"))
                            {
                                elem.InvokeMember("Submit");
                                break;
                            }
                        }
                    }
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question