Re: How can I automate a task like open browser and click a button?

Adam Tuliper <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
you can do it as described below - but if you want browser
integration for whatever reason...just useDocumentComplete
 and access the object model to fill in the search box and
submit the form/button.

ex:
html =
IE.Document.frames[1].Document.documentElement.innerHTML

IE.Document.frames[1].Document.Forms[0].submit

This was using some old vb code - events should be the
same/similiar in 2.0
IE was the browser object I started. There were certain
event issues in .net using the library, but haven't tried
the integration with SP1 though but this should be pretty
simple. I had written a site monitoring app this way,
worked decent.



On Mon, 25 Dec 2006 16:44:21 -0800
 brian zinn <[email protected]> wrote:
> Lior,
>
> I think that what you're trying to do can be accomplished
> with frames, but
> it's not very elegant.  Did you try posting the search
> request to the search
> site yourself or using a querystring with the search
> request as a link with
> a target for a new window?  With this type of solution
> you can try using a
> regular newsgroup since it's not .NET specific.  It can
> probably be done
> with straight html and javascript.
>
> Another thing you could try is scraping (HttpWebRequest)
> the target site
> server side and returning the results to the client -
> parsing that
> information will have maintenance issues, though.
>
> -- Brian
>
> On 12/25/06, Lior Levy <[email protected]>
> wrote:
> >
> > Hi,
> > I am trying to automate a task that someone is doing
> like go to search
> > engine type a string clicks the search button save the
> results in a loop.
> > It must be done from a web form.
> >
> > What are these commands? Can they help me?
> > aximp c:\windows\system\shdocvw.dll
> > tlbimp mshtml.tlb
> >
> > Thanks,
> > Lior.
> >
> >
> >
> > -----Original Message-----
> > From: Discussion of building .NET applications targeted
> for the Web
> > [mailto:[email protected]] On Behalf Of
> Shawn Wildermuth
> > Sent: Monday, December 25, 2006 12:09 AM
> > To: [email protected]
> > Subject: Re: [DOTNET-WEB] How can I automate a task
> like open browser and
> > click a button?
> >
> > First, please don't cross post your questions to
> multiple mailing lists
> > until you fail to get an answer on one.
> >
> > TO launch a new browser window is easy, just launch
> iexplorer.exe (or your
> > favorite browser) with the desitanation as a
> commandline parameter.  But
> > setting a value and clicking it could be much harder.
>  What are you trying
> > to accomplish?
> >
> >
> > Thanks,
> >
> > Shawn Wildermuth
> > Wildermuth Consulting Services, LLC
> > http://adoguy.com
> > C# MVP, MCSD.NET, Author and Speaker
> >
> > -----Original Message-----
> > From: Discussion of building .NET applications targeted
> for the Web
> > [mailto:[email protected]] On Behalf Of
> Lior Levy
> > Sent: Sunday, December 24, 2006 4:55 PM
> > To: [email protected]
> > Subject: [DOTNET-WEB] How can I automate a task like
> open browser and
> > click
> > a button?
> >
> >
> >
> >
> >
> > Hi,
> >
> >
> >
> > How can I automate a task like open a new browser add a
> text to a textBox
> > and click a button from a webForm?
> >
> >
> >
> > From winForm it dose like this:
> >
> >
> >
> >             HTMLDocument myDoc = new
> HTMLDocumentClass();
> >
> >             myDoc = (HTMLDocument)
> axWebBrowser1.Document;
> >
> >
> >
> >             HTMLInputElement otxtSearchBox =
> (HTMLInputElement)
> > myDoc.all.item("q", 0);
> >
> >             otxtSearchBox.value = "intel corp";
> >
> >
> >
> >             HTMLInputElement btnSearch =
> (HTMLInputElement)
> > myDoc.all.item("btnI", 0);
> >
> >             btnSearch.click();
> >
> >
> >
> > Thanks,
> >
> > Lior.
> >
> >
> >
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)
>  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)
>  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)
>  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor®
>  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

---------------------------------------------------------------------
Web mail provided by NuNet, Inc. The Premier National provider.
http://www.nni.com/

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.