LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

autologin post method

HI there,

attached is my attempt at tracking an item with a reference number on the tnt website. 
The idea is:

1. Navigate to page
2. Enter tracking number into form
3. Submit the form and recieve the returned page with the status of the order.

My code attached sort of works but doesn't submit the data and return the status page correctly.  It uses the "post" method and it doesn't seem to have any elements in the form to submit with.  It submits my the user clicking on the "track" button.  What code can I use to invoke this track button to be pressed?

Thanks
Message 1 of 27
(5,746 Views)

Hi Sniepsy,

     After seeing your first post I actually spent some time on this Smiley Happy - but navigating the MSHTML objects is a mess!Smiley Mad  Possibly there's an alterntive for "Submit" - for instance, is it possible to invoke the "click" method of the "track" image object instead?  I tried this but could never be sure I'd selected/cast the right object (and "click" never did anything).  FYI: It appears security-settings can interfere with this page - in IE, if "internet" security is set higher than "Medium", make sure this is a "trusted site". Smiley Wink

I know it's not much help - sorry!

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 27
(5,727 Views)

Hi tbd,

Thanks for taking a look at it, I was working down the same track with the click idea but ran into the same trouble.  The concept is easy, and should be a straight forward program but this has so far beaten me.   I think the code I need is exactly as you say, isolate the button "track" and invoke a click on it.  Any of you NI guys and gals got any ideas on this?

 

Cheers

0 Kudos
Message 3 of 27
(5,723 Views)
Hi,

I was looking at the source code for the web page you submitted and it seems to me that while clicking the button, two actions are taking place.  One is an onClick action called checkandsubmit() and the other is onkeyup called checkcount1().  I believe that you need to include this into your code and handle these events.  The way I found these two actions is by looking at the source code when you click the button track.

I hope this helps,

Regards,

Nadim
Applications Engineering
National Instruments
0 Kudos
Message 4 of 27
(5,701 Views)

Hi Nadim,

Having spent several more hours on this, your interest in helping is appreciated.  Can you help determine what kind of object the track <input> is? (type="image").  Also, how to get a reference to it?  It doesn't seem to be accessible on the "id" form (which has only 4 objects) and while the document returns 63 "IMG" objects in the images collection, none of them seems to be for "track".  When I pause the page after Sniepsy writes the tracking number, and during the pause, manually click "track" - the page navigates to the desired page, so, maybe the "click" method is enough - if we can just invoke it on the correct object. Smiley Wink  BTW, when/if we can invoke track/"click", then checkandsubmit() will be performed by the browser. Smiley Happy

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 27
(5,689 Views)

tbd,

you are definately on to something but I am having trouble as maybe you are, isolating elements and then applying a method to them.  Yi Y do you know how to invoke a click on this track button? 

I cant seem to isolate this button and add a click method.  Is the track button an element of the "id" form?  It doesn't appear to be. 

How can you isolate all buttons as elements, and which form are they in (if any) and then provide an invoke method to them.

 

cheers

0 Kudos
Message 6 of 27
(5,666 Views)

Hi Sniepsy,

Just an FYI, I'll be working on this for the next few hours - please let me know if you've made any progress!  Am currently looking at "links" and "all" document properties.  "All" has a length of 767 objects - one of them must be the track image! Smiley Tongue

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 7 of 27
(5,648 Views)

Hi tdb,

The image for track is called nav_icon_t.gif as you are probably aware.  So now we just need to isolate this image and click it!

It is a bit past my knowledge of web programming, so I'm hoping one of you may know how to do it.  I dont really understand the process of isolating images, so if you can shed some light would be great.  I've attached a new copy of my code which works with fedex tracking.  It has a submit element to the form so it works.

Dont waste too much of your time on it tdb, unless of coarse you may need this function for yourself.  I cant afford to waste to much time on it, and I figure someone will eventually show us, in 5 seconds how to do it.  where is that person?

 

Cheers

0 Kudos
Message 8 of 27
(5,642 Views)

Hi Sniepsy,

      Found "track" item in Documents:All... CLICK! Smiley Happy

I don't mind spending time on interesting stuff - and programmatic-web-page navigation is interesting to me (, though you know the old saying: "little things amuse little minds" Smiley Very Happy ).

Cheers!

Message Edited by tbd on 08-25-2007 12:16 AM

Message Edited by tbd on 08-25-2007 12:17 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 9 of 27
(5,645 Views)
... back-saved to 8.0 Smiley Wink
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 10 of 27
(5,629 Views)