Internet Explorer, COM+, Javascript and Python

Discussion in 'Python' started by Ishpeck, Apr 27, 2005.

  1. Ishpeck

    Ishpeck Guest

    Ishpeck, Apr 27, 2005
    #1
    1. Advertising

  2. Ishpeck

    Roger Upole Guest

    Something like this should be close:

    import win32com.client, pythoncom
    ie=win32com.client.Dispatch('internetexplorer.application')
    ie.Visible=1
    ie.Navigate('somepagewithjavascript.html')
    id=ie.Document.Script._oleobj_.GetIDsOfNames('somejsfunction')
    res=ie.Document.Script._oleobj_.Invoke(id, 0, pythoncom.DISPATCH_METHOD,
    True, <parameter or tuple of parameters> )

    hth
    Roger


    "Ishpeck" <> wrote in message
    news:...
    >I need to make IE execute javascript in a web page with COM+ and
    > Python.
    >
    > Similarly to the way they do it in this article. . .
    >
    > http://www.codeproject.com/com/jscalls.asp
    >




    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
    Roger Upole, Apr 28, 2005
    #2
    1. Advertising

  3. Ishpeck

    J Correia Guest

    "Roger Upole" <> wrote in message
    news:4270c6ed$1_2@127.0.0.1...
    > Something like this should be close:
    >
    > import win32com.client, pythoncom
    > ie=win32com.client.Dispatch('internetexplorer.application')
    > ie.Visible=1
    > ie.Navigate('somepagewithjavascript.html')
    > id=ie.Document.Script._oleobj_.GetIDsOfNames('somejsfunction')
    > res=ie.Document.Script._oleobj_.Invoke(id, 0, pythoncom.DISPATCH_METHOD,
    > True, <parameter or tuple of parameters> )
    >
    > hth
    > Roger


    Yes, that definitely works. Only one minor correction: it seems that to
    pass multiple parameters you need to pass them sequentially seperated by
    commas instead of in a tuple, i.e.
    res=ie.Document.Script._oleobj_.Invoke(id, 0, pythoncom.DISPATCH_METHOD,
    True, param1, param2, param3, ......... )

    Useful test sitefor above code:
    http://www.cpplab.com/Articles/JSCalls/TestPage/JSCallTestPage.htm

    HTH,

    >
    >
    > "Ishpeck" <> wrote in message
    > news:...
    > >I need to make IE execute javascript in a web page with COM+ and
    > > Python.
    > >
    > > Similarly to the way they do it in this article. . .
    > >
    > > http://www.codeproject.com/com/jscalls.asp
    > >

    >
    >
    >
    > ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet

    News==----
    > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+

    Newsgroups
    > ----= East and West-Coast Server Farms - Total Privacy via Encryption

    =----
    J Correia, Apr 28, 2005
    #3
  4. Ishpeck

    dannyguindi Guest

    Re: COM+, Javascript and Python

    Do you guys know if there is a way to do this in Linux?
    Thanks.

    Danny
    dannyguindi, May 31, 2005
    #4
  5. Ishpeck

    Peter Hansen Guest

    Re: COM+, Javascript and Python

    dannyguindi wrote:
    > Do you guys know if there is a way to do this in Linux?


    What is "this"? Your subject line provides a context, but not a problem
    to which we can give you the solution. Please be specific.

    -Peter
    Peter Hansen, May 31, 2005
    #5
    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. WL
    Replies:
    2
    Views:
    2,931
  2. cmay
    Replies:
    0
    Views:
    1,129
  3. Coyote
    Replies:
    2
    Views:
    341
    Coyote
    Oct 16, 2006
  4. Ed Hauptman
    Replies:
    7
    Views:
    1,014
    Ed Hauptman
    Aug 7, 2009
  5. John Smith
    Replies:
    1
    Views:
    139
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page