Jump to content

login in my ebay problem


Recommended Posts

hi guys  some day ago i create a automatic login for my ebay account , it work good  but  today stopped to work , i think is problem with javascript or bho

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <IE.au3>
#include <Array.au3>
#include <INet.au3>
#include <Debug.au3>

Global $iGTimeToCeckTruck = 1000, $iGTimeOutTruck = 1000, $oIE
Global $sGUtente = "xxxxxxx", $sGUsereBayLogAcqu = "", $sGPasseBayLogAcqu = ""

_Login_eBay()

Func _Login_eBay()
    $sGUsereBayLogAcqu = "xxxxxxx"
    $sGPasseBayLogAcqu = "xxxxxxx"

    If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running.
        ProcessClose("iexplore.exe")
    EndIf
;   $oIE = _IECreate("https://signin.ebay.it/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=101&ru=https%3A%2F%2Fmy.ebay.it%2Fws%2FeBayISAPI.dll%3FMyEbayBeta%26MyEbay%3D%26gbh%3D1%26guest%3D1&pageType=3984", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    $oIE = _IECreate("https://signin.ebay.it/ws/eBayISAPI.dll?SignIn&ru=https%3A%2F%2Fwww.ebay.it%2F", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE, $iGTimeToCeckTruck, $iGTimeOutTruck)
    $iLCtrlDelay = 0

    Do
        Local $sLBodyHtl = _IEBodyReadHTML($oIE)
        If StringInStr($sLBodyHtl, "learnMoreLink") Then
            $iLCtrlDelay = 1

        EndIf
        If StringInStr($sLBodyHtl, "Ciao") Then
            $iLCtrlDelay = 1

        EndIf
    Until $iLCtrlDelay = 1

    If StringInStr($sLBodyHtl, "Email o nome utente") Then

        Local $oLogin = _IEGetObjByName($oIE, "userid")
        _IEAction($oLogin, "focus")
        _IEAction($oLogin, "Click")
        ;_IEFormElementSetValue($oLogin, $CmdLine[1]) ; user
        _IEFormElementSetValue($oLogin, $sGUsereBayLogAcqu) ; user
MsgBox(0,'','sono qui')
        Local $oBtns = $oIE.document.GetElementsByTagName("button")
        For $oBtn In $oBtns
            $id = String($oBtn.id())
            ;ConsoleWrite($classname & @CRLF)
            If $id = "sgnBt" Then
                _IEAction($oBtn, "click")
                ;   _IEFormElementSetValue($oBtn, $sUser)
            EndIf
            If $id = "signin-continue-btn" Then
                _IEAction($oBtn, "click")
                ;   _IEFormElementSetValue($oBtn, $sUser)
            EndIf
        Next
    EndIf
    Sleep(5000)
    If StringInStr($sLBodyHtl, "password") Then
        Local $oPassword = _IEGetObjByName($oIE, "pass")

        _IEAction($oPassword, "focus")
        _IEAction($oPassword, "Click")
        ;_IEFormElementSetValue($oLogin, $CmdLine[1]) ; user
        _IEFormElementSetValue($oPassword, $sGPasseBayLogAcqu) ; user
        Local $oBtns = $oIE.document.GetElementsByTagName("button")
        For $oBtn In $oBtns
            $id = String($oBtn.id())
            ;ConsoleWrite($classname & @CRLF)
            If $id = "sgnBt" Then
                _IEAction($oBtn, "click")
                ;   _IEFormElementSetValue($oBtn, $sUser)
            EndIf
            If $id = "signin-continue-btn" Then
                _IEAction($oBtn, "click")
                ;   _IEFormElementSetValue($oBtn, $sUser)
            EndIf
        Next
    EndIf
    endfunc

anyone can help me ?

thankz again

 

Link to comment
Share on other sites

you may want to use eBay API instead of browser automation.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

ebay api work only for seller , now  implement api side buyer  , but  is not complete , i want list items bought ,for give in semi-automatic manner a feedback, (this is my scope ) , but for that , not  exist api (that i know of)

Link to comment
Share on other sites

  • Moderators

@faustf you have been around long enough to know "doesn't work" doesn't help anyone help you. Think about the information you are putting into a post, and whether you would have enough to go on. WHAT errors are you seeing, or AT WHAT POINT is it failing, WHAT has changed on your system, WHEN did it last work as expected - these are all the most basic of questions you should include in a post for help.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

...I used to enjoy let my mind run, my fingers type, ...all in line, who needs functions !, ..this makes sense, all .... . After a while I learned to take my time, functionize as much as possible and magically became more proficient. I'm just a scripter, I could not make a DLL call if my life depended on it.
I know that if you slow down ( your mind ) your code can be something beautiful, ... ppl would fall in love with it. :D 

Edit:

Func _Login_eBay($sGUsereBayLogAcqu = "xxxxxxx", $sGPasseBayLogAcqu = "xxxxxxx")
... ...

...that type of coding.

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

@argumentum

take  a start at "UDF" aslo if i dont like  do UDF  with macro , i think is not much stable , i think if exist API  will be  better

#include <IE.au3>


$url = "https://signin.ebay.it/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=101&ru=https%3A%2F%2Fmy.ebay.it%2Fws%2FeBayISAPI.dll%3FMyEbayBeta%26MyEbay%3D%26gbh%3D1%26guest%3D1&pageType=3984"
$User = "XXXXXX"
$Pass = "xxxxxx"


_eBayLogin($url,$User,$Pass)

Func _eBayLogin($sUrl,$sUser,$sPass)
    $oIE = _IECreate($sUrl, 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer

$oDoc = _IEDocGetObj($oIE)
$oEvt = $oDoc.createEvent("HTMLEvents")
$oEvt.initEvent("input", True, False)
Sleep(5000)
$oUsername = _IEGetObjById($oIE,"userid")
_IEFormElementSetValue($oUsername, $sUser)
$oUsername.dispatchEvent($oEvt)
Sleep(1000)
$oButton = _IEGetObjById($oIE,"signin-continue-btn")
_IEAction($oButton, "click")

Sleep(5000)
$oPassword = _IEGetObjById($oIE,"pass")
_IEFormElementSetValue($oPassword, $sPass)
$oPassword.dispatchEvent($oEvt)
Sleep(1000)
$oButton = _IEGetObjById($oIE,"sgnBt")
_IEAction($oButton, "click")
EndFunc

 

Link to comment
Share on other sites

  • 1 month later...
  • Moderators

@DING since the code above is using the IE library, no you cannot just convert it to work on Chrome. If you use the forum's search function, however, you will find a myriad of other ways to accomplish this task with Chrome, such as the Chrome library, the IUIAutomation thread, or the WebDriver thread.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...