Sign in to follow this  
Followers 0
ItchyBalls666

Unable to obtain img/links/forms from website

9 posts in this topic

Hello guys, I've been trying to create a simple autoit program that automatically create accounts for you by performing a series of macros. However, when i try to obtain img/links/forms from this site, nothing shows up. Therefore I am unable to continue with my program. I just want to ask if i am doing something wrong with my coding or if the site is encrypted in some way and how to get past it. Thanks in advance :mellow::(

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <Array.au3>

$oIE = _IECreateEmbedded()
$Form1 = GUICreate("Form1", 779, 587, 193, 125)
$Input1 = GUICtrlCreateInput("ID", 592, 8, 177, 21)
$Input2 = GUICtrlCreateInput("Password", 592, 40, 177, 21)
$Input3 = GUICtrlCreateInput("Secret Answer", 592, 72, 177, 21)
$Button1 = GUICtrlCreateButton("Create", 592, 104, 177, 25, 0)
$Button2 = GUICtrlCreateButton("Refresh", 592, 136, 177, 25, 0)
$Gui = GUICtrlCreateObj($oIE, 8, 8, 572, 569)
GUISetState(@SW_SHOW)
_IENavigate($oIE, "http://www.joymax.com/portal/", 1)
;_IEimgClick($oIE, "http://img.joymax.com/property/joymax/joymax_portal_2/icon_img/but_img/acc_03.gif")
;_IENavigate($oIE, "https://www.joymax.com/portal/Joymax_Front.jmx?workURL=https://portalcp.joymax.com/member/memberJoin.jmx&returnURL=http://www.joymax.com/portal/Joymax_Front.jmx?workURL=http://portalcp.joymax.com/Joymax.jmx", 1)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button1
            $oImgs = _IEimgGetCollection($oIE)
            MsgBox(1, " ", @extended)
            For $oImg in $oImgs
            ConsoleWrite($oImg.src & @CR)
            Next
        ;_IEFormImageClick($oIE, "https://img3.joymax.com/property/joymax/joymax_portal_2/icon_img/but_img/agree.jpg")
    EndSelect
WEnd

Share this post


Link to post
Share on other sites



If you can't find any <img src="xxx"> tags in the HTML code you won't be able to find them with _IEImgGetCollection. This often happens in dynamic pages that rely on Javascript or AJAX. In that cause, you won't be able to automate the webpage ( at least, my attempts so far have been unsuccesful. )

Share this post


Link to post
Share on other sites

Oh I see, thanks for the useful information. Are there any alternatives to this? I made one using a series of send() and mouseclicks(), but I don't it is too reliable.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Oh I see, thanks for the useful information. Are there any alternatives to this? I made one using a series of send() and mouseclicks(), but I don't it is too reliable.

There are a few methods you might use to improve reliability of your application. There is no standard set of methods, so I'm just going to give you the methods I use often.

× Use Win* to check the title of the application

× Use _IE functions to check on what page exactly you are, or to automate any forms

× Use a minimal amount of Send or Mouse* functions, replace them with _IE functions as much as you can

× Use ClientCoordMode, and other AutoIt options to get optimal performance and reliability

I might have more tips for you later..

Edited by Manadar

Share this post


Link to post
Share on other sites

Thanks for the reply, I am able to successfully get the full title of the application, which is the title of the GUI. But as far as the _IE functions goes, I think the site, like you've said, is a "dynamic page that relies on javascript or AJAX". Therefore I am unable to obtain any information for the website using _IE functions. All the @extended = 0 and no img/form/elements/links are found.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Extremely useful, thanks:mellow:

Edited by ItchyBalls666

Share this post


Link to post
Share on other sites

Welcome

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Extremely useful, thanks:mellow:

Nvm, contains errors. My bad for double posting, the edit link was gone:(

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