Need help navigating a page

Started by mathia, July 25, 2014, 09:11:40 AM

Previous topic - Next topic

mathia

I can probably make it work, but it's a bit inconsistent when trying to find the IE window.  I initially had to open another window just to get it to detect the browser.

td

The whole process of using IE's COM Automation interfaces to manipulate websites is a first-order kludge.  The constantly changing and inconsistently followed standards only add to fun.   

Here is the link to Jay's afore mentions tutorial in case you haven't found it yet.

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+Tutorials+Working~With~Web~Pages.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mathia

I'm still wrestling with getting the UDF to recognize the windows I have open.  Not sure what the issue is. I have only gotten it to work once, so far.
I'm wondering if I can modify and execute the code attached to the button I am clicking.  The line in question is this:

<input class="btn100" onclick="openWindow('docUploadAdhocFile.asp',800,550)" type="button" value="Display Form"/>

Is there a way to get this to display in the current window rather than opening a new one.  Site code is totally outside my control, but I though it might be possible to send this directly to the page to get it to do my bidding. 

td

Wild guess is that your "Shell.Application" problem is the result of some kind of timing issue.  The timing problem could be in one of several places during the process. The problem could even be creating the "Shell.Application" object prematurely.

I am not aware of any generic something or another you could send to the server to change window creation behavior.  If there is such a thing, best guess is that it would be site specific.   

The 'openWindow' method likely is a javascript method.  In theory it is possible to execute a client side script that would override one or more javascript functions sent by the site with your own functions.  Your own functions could modify site behavior as you see fit.   I have never tried this using IE COM Automation interfaces so I have no idea if it will work in that context.

Some browsers allow you to maintain a library of javascipt overrides that can be associated with specific web pages.  My browser of choice supports site specific javascript libraries and I have used this functionality successfully.     
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: td on August 04, 2014, 11:32:44 AM
The 'openWindow' method likely is a javascript method.  In theory it is possible to execute a client side script that would override one or more javascript functions sent by the site with your own functions.  Your own functions could modify site behavior as you see fit.   

I've seen this done, in FireFox with Ruby. Ruby (and I guess Python) can harvest Ajax and PHP to manipulate web sites.

mathia

I assumed it was possible, but I don't know how to do it.

mathia

I found this article yesterday, which might shed some light on problems getting a handle to a new browser window.  I have modified my code to launch the browser with a Run command, then get a handle.  This works for most of the script, but once I get to the part that opens a new window, the shell object is not seeing the new window, just the one I launched initially.

http://blogs.msdn.com/b/ieinternals/archive/2012/02/07/10192483.aspx

mathia

Since I can't get a handle using the shell object, is it possible to get a handle if you have the process id?

JTaylor

Did you try to "navigate" to that asp page you wanted?  Not sure what you are trying to do overall but if it works it would eliminate your stated problem, as I understand it anyway.

Jim

mathia

That definitely would have eased my troubles, but I have not been able to get it to work.