Jump to content

reading the wrong page


Recommended Posts

it's probable me who's tired but I can't see what's the problem here...

The page opens, moves to the hospital page but when it reads, it reads from the frontpage instead of the text that's on the hospitalpage...

#include <IE.au3>
#include <String.au3>
$oIE = _IECreate  ("http://apps.facebook.com/inthemafia/")
_IELinkClickByText ($oIE, "Hospital")
WinWaitActive("Facebook | Mafia Wars - Windows Internet Explorer")
Sleep(5000)
$sText = _IEBodyReadText ($oIE)

input plz?

Link to comment
Share on other sites

#include <IE.au3>
#include <String.au3>
$oIE = _IECreate  ("http://apps.facebook.com/inthemafia/")
_IELinkClickByText ($oIE, "Hospital")
WinWaitActive("Facebook | Mafia Wars - Windows Internet Explorer")
Sleep(5000)
$sText = _IEBodyReadText ($oIE)

Hmm, I don't have a facebook account, so I'm not sure why you're getting the wrong source, but since _IELinkClickByText waits for the page to load (unless you tell it not to), do you really need the WinWaitActive and the Sleep?

Edited by exodius
Link to comment
Share on other sites

I added those to see if they would solve the problem... I wanted to try either sleep or WinWaitActive...

the problem is that it's not clicking the link I want...

$oIE = _IECreate  ("http://apps.facebook.com/inthemafia/") ;open page
_IELinkClickByText ($oIE, "Fight")
_IELinkClickByText ($oIE, "Attack")

as far as I get it, the script should open the webpage, click on the Fight link and then on teh Attack link.

but there I always get this error: --> IE.au3 V2.4-0 Warning from function _IELinkClickByText, $_IEStatus_NoMatch

any idea? the link is there...

that is why I tried reading the webpage to text to verify that the link is actually there. but even the code on top doesn't give a result...

Edited by Overlord
Link to comment
Share on other sites

Please get DebugBar (see my sig) so that you can more readily examine the interpretted source. Watch closely for Frames and iFrames.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...