Jump to content
Sign in to follow this  
tiger858

Auto log-in for dropbox

Recommended Posts

tiger858
I have this code but it does not work can you please tell me why ? 
 
#include <IE.au3>


$oIE = _IECreate("https://www.dropbox.com/login?lhs_type=anywhere")




$username= _IEFormGetObjByName($oIE, "login_email")
$password=_IEFormGetObjByName($oIE,"login_password")
$submit=_IEFormGetObjByName($oIE,"login_submit_dummy")



_IEFormElementSetValue($username, "username")
_IEFormElementSetValue($password, "password")
_IEAction($submit, "click")
Also after i log in i would like to do a search within drop box how would i do this 
Edited by tiger858

Share this post


Link to post
Share on other sites
water

You need to add some error checking to your code. Every _IE* function sets @error to a non zero value to describe the type of error.

The help file is your friend too ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

i have been reading the help file and i can't even seem to get that copy paste script to work haha

#include <IE.au3>
 
Local $oIE = _IECreate("http://www.google.com")
Local $oForm = _IEFormGetObjByName($oIE, "f")
Local $oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
 
straight from the help file but does not work :(

Share this post


Link to post
Share on other sites
water

Add some error checking:

Global $oIE = _IECreate("http://www.google.com")
ConsoleWrite("_IECreate: " & @error & @LF)
Global $oForm = _IEFormGetObjByName($oIE, "f")
ConsoleWrite("_IEFormGetObjByName: " & @error & @LF)
Global $oQuery = _IEFormElementGetObjByName($oForm, "q")
ConsoleWrite("_IEFormElementGetObjByName: " & @error & @LF)
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
ConsoleWrite("_IEFormElementSetValue: " & @error & @LF)
_IEFormSubmit($oForm)
ConsoleWrite("_IEFormSubmit: " & @error)
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

BTW:

Please enclose AutoIt code in code tags. The editor has a blue Autoit icon for that.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

 

Add some error checking:

Global $oIE = _IECreate("http://www.google.com")
ConsoleWrite("_IECreate: " & @error)
Global $oForm = _IEFormGetObjByName($oIE, "f")
ConsoleWrite("_IEFormGetObjByName: " & @error)
Global $oQuery = _IEFormElementGetObjByName($oForm, "q")
ConsoleWrite("_IEFormElementGetObjByName: " & @error)
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
ConsoleWrite("_IEFormElementSetValue: " & @error)
_IEFormSubmit($oForm)
ConsoleWrite("_IEFormSubmit: " & @error)

I used your script and it ran but still just opened the ie page to google and did nothing , how do i check errors ?

sorry for all the newbie questions don't mean to be annoying , thank you for trying to help :D

Edited by tiger858

Share this post


Link to post
Share on other sites
water

The

ConsoleWrite("xxx: " & @error)

statements that return values <> 0 denote an error.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

it does not look like it returns anything ? 

Share this post


Link to post
Share on other sites
water

if I press F5 in SciTE to run the script I get:

>Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Temp\Test.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
_IECreate: 0
--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
_IEFormGetObjByName: 7
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
_IEFormElementGetObjByName: 3
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
_IEFormElementSetValue: 3
--> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
_IEFormSubmit: 3
+>15:40:31 AutoIt3.exe ended.rc:0
>Exit code: 0    Time: 1.121

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

it just runs the script , maybe because i'm in windows 8 ?

also did you put #include <IE.au3> in ? 

Edited by tiger858

Share this post


Link to post
Share on other sites
water

No.

If you press F5 in SciTE you always get this output in the error pane in the lower part of the screen.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

oh was not looking at that part sorry :(  

so where do i go from here ? 

Share this post


Link to post
Share on other sites
water

also did you put #include <IE.au3> in ? 

Sure. Doesn't work without this statement.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

The example script works fine as soon as you replace

Global $oForm = _IEFormGetObjByName($oIE, "f")

with

Global $oForm = _IEFormGetObjByName($oIE, "gbqf")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Which error messages do you get from your original script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

oh so the script must of been old and google updated ? okay i think i'm getting my head wrapped around this a little more now , sorry for being so annoying. what would be the easiest way to find the $oForm of a page ?

Share this post


Link to post
Share on other sites
water

Search the sourcecode for "<form".


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

include <IE.au3>

 

 

$oIE = _IECreate("https://www.dropbox.com/login?lhs_type=anywhere")
ConsoleWrite("_IECreate: " & @error & @LF)
 

 

 

 
$o_Form=_IEFormGetObjByName($oIE,"t")
ConsoleWrite("_IEFormGetObjByName: " & @error & @LF)
$o_username= _IEFormElementGetObjByName($o_Form, "login_email")
ConsoleWrite("_IEFormElementGetObjByName: " & @error & @LF)
$o_password=_IEFormElementGetObjByName($o_Form,"login_password")
ConsoleWrite("_IEFormElementGetObjByName: " & @error & @LF)




 

 

_IEFormElementSetValue($o_username, "username")
ConsoleWrite("_IEFormElementSetValue: " & @error & @LF)
_IEFormElementSetValue($o_password, "password")
ConsoleWrite("_IEFormElementSetValue: " & @error & @LF)
_IEFormSubmit ($o_form)
ConsoleWrite("_IEFormSubmit: " & @error)

i updated original , still doe not work 

but error is 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Dan\Desktop\ssssssssssssssssssss.au3"
_IECreate: 0--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
_IEFormGetObjByName: 7--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
_IEFormElementGetObjByName: 3--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
_IEFormElementSetValue: 3--> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
_IEFormSubmit: 3>Exit code: 0    Time: 1.227

Share this post


Link to post
Share on other sites
water

Looks like "t" is not the name of the login form.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tiger858

<form action="/login" novalidate="novalidate" method="post"><input type="hidden" name="t" value="vgY1oWb3gPVzLr_Xb5dxKdRS" /><input type="hidden" name="lhs_type" value="default" /><div class="alternative-option">(or <a id="register-link">create an account</a>)</div><div class="title-text">Sign in</div><div id="login-partial">

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  

×