[RESOLVED] webbrowser problem (used to work well - I *might* have badly played in references)
I use a webbrowser to browse a page and and log in my account.
This used to work great - but I think I might have badly played with references, now causing an error. But stangely enough, my code still works on some older project/other web pages.
If I use IE, I can easily browse:
http://passeport.canoe.ca/cgi-bin/lo...uel/index.html
But this stopped working in my VB project:
Code:
frmPrincipal.Web.Navigate "http://passeport.canoe.ca/cgi-bin/login.cgi?evenement=laclassede5e&back_url=http://tva.canoe.ca/emissions/laclassede5e/jeu_virtuel/index.html"
...This will browse me to the "PAGE NOT FOUND".
If I am lucky enough and the web page loads (yes, hapens, rarely, but it does) I then fill the login/password fields:
Code:
With frmPrincipal.Web.Document.All
.Item("username").Value = "del_ea"
.Item("passwd").Value = "del_e"
frmPrincipal.Web.Document.Forms(1).submit.Click
End With
...but this will end up on a "PAGE NOT FOUND", too.
Anyone has a clue? How could I have messed with the references and have it work on other webpages? I just checked a backup I had from 6 months ago and I re-inserted all the same references in the same order. Didn't help.
This error started hapening on the target computer, only to discover it was now doing the same thing on my machine.
Thank you for your help / comments
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Perhaps the site just go down at times?
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Like I said, it works in IE. Only in VB will it give me trouble.
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Yep, I have exactly the same problem with your link and your documents object names
Re: webbrowser problem (used to work well - I *might* have badly played in references)
This is almost making me happy. What can be causing this? Could the webpage detect that we're accesing it via an 'app with webbrowser'?
Even tho I really don't know why'd they do this...
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Quote:
Originally Posted by Krass
This is almost making me happy. What can be causing this? Could the webpage detect that we're accesing it via an 'app with webbrowser'?
Even tho I really don't know why'd they do this...
You would almost think that, wouldn't you?
But I do not believe this to be the case. Right now I haven't been able to figure out what is going on other than sometimes I get back a page that didn't come from the original URL you navigate to. I'll keep playing with it as it also makes me a little enthusiatic about it
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Since this project is kinda important for me - I am thanking you in advance for 'working' on something you wouldn't normally care about.
Very nice from you.
I was beginning to think I might have to try a webbrowser alternative (firefox webbrowser control perhaps?!).
I know the part of filling usernames and passwords (and clicking submit) is not the faulty part, because the same behaviour will occur if I browse to the first page and do the rest of the routine manually.
You might want to keep in mind that after using the login/password, you somehow get 'connected' with your account and clicking "logout" might be necessary... But I really don't think so. Just giving my thoughts..
Thank you.
1 Attachment(s)
Re: webbrowser problem (used to work well - I *might* have badly played in references)
See if this will help you in any way shape or form.
Re: webbrowser problem (used to work well - I *might* have badly played in references)
Hi there.
Your code seems to work.
The thing is that my code re-started to work, too. Without changing anything. I don't know why. Your code seems pretty similar to mine.
Maybe it's a cookie thing that needed to be cleared up?.. or.... I don't know why. Inteferring cache files - .... :confused:
Thank you very much!
Re: [RESOLVED] webbrowser problem (used to work well - I *might* have badly played in references)
If you noticed I didn't use frmPrincipal.Web.Document.Forms(1).submit.Click because I was never able to get that to ever actually submit. So I changed it to actually find the <input..... tag, which had no name so I had to loop in a For....Next until I found the one that had the correct http://..... link in it, and used that to do a .Click.