COM (DispatchEx) problem

Discussion in 'Python' started by Leszek, Aug 16, 2004.

  1. Leszek

    Leszek Guest

    Hi everybody !

    I'm starting my script with:

    ie = win32com.client.DispatchEx("InternetExplorer.Application")
    ie.Visible = 1
    ie.Navigate("http://www.chip.pl")

    while ie.Busy == True:
    win32api.Sleep(1000)

    doc = ie.document

    then I make "submit" and new page opens.
    but

    print doc.body.innerHtml

    gives the same Html code than before "submit". What is going on ? How to see
    new document ?

    Thanks for any help.

    Leszek
    Leszek, Aug 16, 2004
    #1
    1. Advertising

  2. Leszek

    Paul McGuire Guest

    "Leszek" <> wrote in message
    news:cfpqlu$nb6$...
    > Hi everybody !
    >
    > I'm starting my script with:
    >
    > ie = win32com.client.DispatchEx("InternetExplorer.Application")
    > ie.Visible = 1
    > ie.Navigate("http://www.chip.pl")
    >
    > while ie.Busy == True:
    > win32api.Sleep(1000)
    >
    > doc = ie.document
    >
    > then I make "submit" and new page opens.
    > but
    >
    > print doc.body.innerHtml
    >
    > gives the same Html code than before "submit". What is going on ? How to

    see
    > new document ?
    >
    > Thanks for any help.
    >
    > Leszek
    >

    If you are just trying to get at the HTML source for a given URL, use urllib
    or urllib2.

    Here's the code to get the HTML source for yahoo.com:

    import urllib
    serverListPage = urllib.urlopen( "http://www.yahoo.com" )
    htmlSource = serverListPage.read()
    serverListPage.close()

    Bypasses the whole COM and IE mess, and it's portable, to boot!

    -- Paul
    Paul McGuire, Aug 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,968
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,145
    Ted Miller
    Sep 13, 2003
  3. Merek
    Replies:
    0
    Views:
    1,956
    Merek
    Dec 3, 2003
  4. Replies:
    2
    Views:
    1,230
    Roger Upole
    Jun 14, 2006
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    543
    Bullschmidt
    May 11, 2004
Loading...

Share This Page