Call javascript functions in IE with Python/Com
http://win32com.goermezer.de/content/view/170/291/
Tried the above. I am able to call Javascript functions declared in the html file. However, for javascript functions in external js files included in the ht开发者_运维技巧ml, I am not able to call those functions using the above method. Any work arounds for this ?
This sounds like a timing problem that is common with Javascript in the web page. AJAX programmers often need to tell the browser to wait until the page is fully loaded before executing their scripts.
One way to deal with that outside of the browser is to simply insert a time delay, i.e. call some innocuous function on the page, wait a second or two, then call the one you need.
Alternatively, if this method allows you to execute arbitrary Javascript inside the browser, like the way bookmarklets work with javascript: URLs, then use that to attach an event listener to the onload event and make that event listener function call the one that you need.
精彩评论