Jump to content

can't select objects inside iframe


weevil
 Share

Recommended Posts

Hiya,

I am having difficulty getting the IDs of some objects within a webpage.  They all have ID's, but they aren't contained within forms.  using _IEGetObjByID doesnt work, nor does looping through iframes.

 

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    ConsoleWrite(_IEBodyReadHTML($oIE) & @CR)
    Local $goCheck = _IEGetObjById($oFrame, "ID_ACCEPT")
   _IEAction($goCheck , "click")
Next

there are 3 iframes on this site, but there are many more inside an iframe called mainPage.  I can't seem to drill into the nested iframes in order to find the ID "ID_Accept"  I tried looping through them and trying to get some content out on the console, but it wouldn't go into anything:

 

<iframe name="MX_HIDDEN" id="MX_HIDDEN" src="common/hiddenFrame.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
        <iframe name="HTML_UI_HIDDEN" id="HTML_UI_HIDDEN" src="/new_web/common/hiddenFrame2.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
       <iframe name="mainPage" id="mainPage" src="common/blank1.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; position: fixed;"></iframe>
    


--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (ID_ACCEPT)
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType
 
       <iframe name="MX_HIDDEN" id="MX_HIDDEN" src="common/hiddenFrame.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
        <iframe name="HTML_UI_HIDDEN" id="HTML_UI_HIDDEN" src="/new_web/common/hiddenFrame2.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
       <iframe name="mainPage" id="mainPage" src="common/blank1.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; position: fixed;"></iframe>
    


--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (ID_ACCEPT)
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType
 
       <iframe name="MX_HIDDEN" id="MX_HIDDEN" src="common/hiddenFrame.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
        <iframe name="HTML_UI_HIDDEN" id="HTML_UI_HIDDEN" src="/new_web/common/hiddenFrame2.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; overflow: hidden; position: fixed;"></iframe>
       <iframe name="mainPage" id="mainPage" src="common/blank1.html" marginwidth="0" scrolling="no" style="border: currentColor; border-image: none; left: 0px; width: 100%; height: 100%; position: fixed;"></iframe>
    


--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (ID_ACCEPT)
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType

 

All the objects i need are inside the same iframe, I just can't find them!

Capture.PNG.4afdfce422392abee646906d936ce964.PNG

 

Inside the mainBody iframe there's a nested iframe called loginBody, and that's where the real meat of the website is.

 

Thanks!

 

Link to comment
Share on other sites

Try using StringRegExp.

Manual: StringRegExp

Tutorial: Tutorial StringRegExp

"Example" with StringRegExpReplace: 

#include <InetConstants.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko") ;=defines the browser for the page.
Local $winrar_read = BinaryToString(InetRead('https://www.win-rar.com/postdownload.html?&L=4', 1)) ;=link to the page.
Msgbox(0,"link", StringRegExpReplace($winrar_read,'(?is).*?([^versions]\w+ru.exe).*', "https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x64$1")) ;=search in a link by pattern.

 

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