Sign in to follow this  
Followers 0
Scorputer

How do I wait for object in IE?

5 posts in this topic

Hello,

I'm writing some code to load a page with a flash video, Youtube in this case...

$oIE1 = _IECreate ("

)

$tYTPageLoadBegin = _Date_Time_GetSystemTime() ; Timestamp for beginning for YouTube page load

$filecontents = $filecontents&"YT Pageload Begin = "&_Date_Time_SystemTimeToDateTimeStr($tYTPageLoadBegin)&@CRLF

$check = _IELoadWait ($oIE1)

$tYTPageLoadEnd = _Date_Time_GetSystemTime() ; Timestamp for end for YouTube page load

The problem is, while the page reports to load completely, the flash video is not yet ready. Is there a way to wait for an individual object to be ready? I'm currently waiting for 10 seconds before I try to use any of the buttons on the object. Here's an example:

Sleep (10000) ; done like this until I figure out how to wait for the object to load

ControlClick($iewindow1, "", "[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]", "left", 2, 15, 375) ; toggles Play/Pause to Pause

Is there a way to use the class information in an object context, and a way I can specify to wait for said object to load?

Gratefully yours,

- Scorputer

Share this post


Link to post
Share on other sites



Well I know for youtube, you could at least check the color of the progress bar, to see if it loadied anything. But if you want it more robust (I assume you do) I would do some research into where the data goes on your hardrive and then check for that instead.


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites

Well I know for youtube, you could at least check the color of the progress bar, to see if it loadied anything. But if you want it more robust (I assume you do) I would do some research into where the data goes on your hardrive and then check for that instead.

yeah u can check for video filesize with inetgetsize, then wait until temp file matches it . or something like that


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites

You'll find Flash in a webpage embedded in <OBJECT> or <EMBED>. Java applets use <APPLET>. All 3 of these tags simply provide a container to encapsulate an embedded object. Other than height and width there is little that the object is required to supply to the browser. You can find some information here: http://kb.adobe.com/selfservice/viewConten...rnalId=tn_12701

That said, the object MAY provide information by way of attributes on the container tag and MAY honor changes in attributes you make to those attributes (like PARAM, VALUE pairs). It is entirely up to the object however because it is not required by the browser.

Therefore, standard DOM methods like readyState (used by _IELoadWait) to no tapply to these objects. You'll need to study the specific object and find any documentation of its behaviour that may assist you.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0