Results 1 to 10 of 10

Thread: [RESOLVED] webbrowser problem (used to work well - I *might* have badly played in references)

  1. #1

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    Resolved [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
    Chris

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: webbrowser problem (used to work well - I *might* have badly played in references)

    Perhaps the site just go down at times?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    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.
    Chris

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  5. #5

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    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...
    Chris

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  7. #7

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    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.
    Chris

  8. #8
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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.
    Attached Files Attached Files


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  9. #9

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    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 - ....

    Thank you very much!
    Chris

  10. #10
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width