Sign in to follow this  
Followers 0
canlimero

AutoIT with new webmail Yahoo

6 posts in this topic

Hi,

I tries to login to the new Yahoo Webmail and click on Attach file but without success ;)

I think that they used a frame for their webmail but I'm a newbie and I cannot reach the Attach button.

If someone has any idea ...

Thanks

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks for your fast answer!

I already read this.

I attahced my source code.

I try to Get this frame object: "attachmentDownloadFrame"

and the _IETagNameGetCollection cannot find anything ;)

Actually maybe I don't understand the Yahoo source code

#include <IE.au3>
; Create a browser window and navigate to Yahoo

$sWebMail = "www.yahoomail.com"
$sTextToFind_Compose = "Compose"
$sSignOut = "Sign Out"
$username = "xxxx"
$password = "xxxx"


$oIE = _IECreate ($sWebMail)
_IELoadWait ($oIE)

Opt("WinTitleMatchMode", 2)
$title = WinGetTitle("Yahoo", "")
WinSetState($title, "", @SW_MAXIMIZE)
; get pointers to the login form and username, password and signin fields
$o_form = _IEFormGetObjByName ($oIE, "login_form")
$o_login = _IEFormElementGetObjByName ($o_form, "login")
$o_password = _IEFormElementGetObjByName ($o_form, "passwd")


; Login and Password
; Set field values and submit the form
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEFormSubmit ($o_form, 0)
_IELoadWait ($oIE)

; Compose New Message
Sleep(5000)
Send("n")
_IELoadWait ($oIE)


$oFrame = _IEFrameGetObjByName($oIE, "attachmentDownloadFrame"); get a reference to the contents frame
;_IEClickLinkByText($oFrame, "Attach"); click on a link in the contents frame
$sTextToFind_AttachFiles = "Attach"
$oTDs = _IETagNameGetCollection($oFrame, "")
MsgBox(4096, "Test", $oTDs, 10)
For $oTD in $oTDs 
   MsgBox(4096, "Test", $oTD.innerText, 10)
    If String($oTD.innerText) = $sTextToFind_AttachFiles Then
        _IEAction($oTD, "click")
        ExitLoop
    EndIf
Next


_IELoadWait ($oIE)
Edited by canlimero

Share this post


Link to post
Share on other sites

#include <IE.au3>
; Create a browser window and navigate to Yahoo
$url = "www.yahoomail.com"
$sSignOut = "Sign Out"
$username = "XXXX"
$password = "xxxx"

$oIE = _IECreate ($url, 1)
$title = "Yahoo"
WinSetState($title, "", @SW_MAXIMIZE)
$o_form = _IEFormGetObjByName ($oIE, "login_form")
$o_login = _IEFormElementGetObjByName ($o_form, "login")
$o_password = _IEFormElementGetObjByName ($o_form, "passwd")

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEFormSubmit ($o_form, 0)
_IELoadWait ($oIE)

ControlSend($title, "", "Internet Explorer_Server1", "^+p"); Yahoo had a shortcut to hit "compose"

$oForm = _IEFormGetObjByName($oIE, "compose")
$oAttach = _IEFormElementGetObjByName($oForm, "attachfiles")
$oAttach.click
; Attach stuffs here

$oAttachForm = _IEFormGetObjByName($oIE, "attachments")
$oAttachFiles = _IEFormElementGetObjByName($oAttachForm, "attachtop")
$oAttachFiles.click

I used a shortcut key command for composing a new message, and only hit the add attachments button, and then the attach files button on that page. Hopefully that helps you get on your way.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Well Thanks for your answer but I think you did it with the old Yahoo webmail.

My problem is with the New Beta Yahoo Webmail.

But thanks very much

Share this post


Link to post
Share on other sites

Yeah, you didn't provide any source.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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