viewpoint-particle

Author Topic: Need help navigating a page  (Read 25168 times)

mathia

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #35 on: August 01, 2014, 02:10:55 pm »
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

  • Tech Support
  • *****
  • Posts: 3594
    • WinBatch
Re: Need help navigating a page
« Reply #36 on: August 01, 2014, 03:48:48 pm »
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

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #37 on: August 04, 2014, 09:44:41 am »
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

  • Tech Support
  • *****
  • Posts: 3594
    • WinBatch
Re: Need help navigating a page
« Reply #38 on: August 04, 2014, 11:32:44 am »
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

  • Pundit
  • *****
  • Posts: 1307
Re: Need help navigating a page
« Reply #39 on: August 05, 2014, 07:27:03 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

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #40 on: August 05, 2014, 07:38:00 am »
I assumed it was possible, but I don't know how to do it.

mathia

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #41 on: August 05, 2014, 07:45:13 am »
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

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #42 on: August 05, 2014, 08:11:12 pm »
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

  • Pundit
  • *****
  • Posts: 1489
    • Data & Stuff Inc.
Re: Need help navigating a page
« Reply #43 on: August 05, 2014, 10:06:04 pm »
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

  • Newbie
  • *
  • Posts: 44
Re: Need help navigating a page
« Reply #44 on: August 06, 2014, 06:22:32 am »
That definitely would have eased my troubles, but I have not been able to get it to work.