kalfel

Fetch feild values from website

6 posts in this topic

#1 ·  Posted

Hi Folks,

Can anyone help me to fetch field values from the website. My script is all about opening a website link by pass userid as filter value. with the current script my search of record with the passed userid filter is working fine. But i want to fetch value of the OS (field in the search record) and save it in a notepad.

Please help  me to proceed further. 


#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

triage()

Func triage()
    GUICreate("offense triage" ,220,88) ; will create a dialog box that when displayed is centered

    Local $idRadio1 = GUICtrlCreateRadio("Internal", 10, 10, 120, 20)
    Local $idRadio2 = GUICtrlCreateRadio("External", 10, 40, 120, 20)
    Local $eAsset = "some link"
    GUISetState(@SW_SHOW) ; will display an  dialog box with 1 checkbox

     Local $idMsg
    ; Loop until the user exits.
    While 1
        $idMsg = GUIGetMsg()
        Select
            Case $idMsg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $idMsg = $idRadio1 And BitAND(GUICtrlRead($idRadio1), $GUI_CHECKED) = $GUI_CHECKED
                Local $sIP = InputBox("Internal IP Triage", "Please enter the IP address", "", "" , -1, -1, 800, 500)
                 GUISetState(@SW_HIDE)
            Case $idMsg = $idRadio2 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED
                Local $sEIP = InputBox("Internal IP Triage", "Please enter the IP address", "", "" , -1, -1, 800, 500)
                Local $eAssetsearch = $eAsset & $sEIP
                    ShellExecute ( "C:\Program Files\Internet Explorer\iexplore.exe", $eAssetsearch )
                        GUISetState(@SW_HIDE)
                EndSelect
    WEnd
EndFunc   ;==>Example
 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Check out the _IE functions in the help file. You will need to provide more details with sample html, etc. if you want a more detailed response.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hi Danp2,

Am a newbie to auto it so the am confused in choosing the appropriate -IE functions.

and to add a note more in detail. Am trying to search a Machine name assigned to user its a web application. where we can search with the user id and fetch his inventory details.

Am successful in login and passing userid. The search is also successful but i ve no clue how to grab the displayed machine name to a notepad.

Thanks in advance.

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

Kalfel,

Show us your existing code where you are logging in and performing the search. Then show us the HTML from the search results.

Dan

Share this post


Link to post
Share on other sites

#5 ·  Posted

Hi Dan,

This is my code.

include <IE.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

triage()

Func triage()
    GUICreate("offense triage" ,220,88) ; will create a dialog box that when displayed is centered

    Local $idRadio1 = GUICtrlCreateRadio("IP", 10, 10, 120, 20)
    Local $idRadio2 = GUICtrlCreateRadio("userid", 10, 40, 120, 20)
    Local $eAsset = "some link"  
    GUISetState(@SW_SHOW) ; will display an  dialog box with 1 checkbox

     Local $idMsg
    ; Loop until the user exits.
    While 1
        $idMsg = GUIGetMsg()
        Select
            Case $idMsg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $idMsg = $idRadio1 And BitAND(GUICtrlRead($idRadio1), $GUI_CHECKED) = $GUI_CHECKED
                Local $sIP = InputBox("Internal IP Triage", "Please enter the IP address", "", "" , -1, -1, 800, 500)
                 GUISetState(@SW_HIDE)
            Case $idMsg = $idRadio2 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED
                Local $sEIP = InputBox("userid Triage", "Please enter the userid", "", "" , -1, -1, 800, 500) ;giving input for search filter
                Local $eAssetsearch = $eAsset & $sEIP
                    ShellExecute ( "C:\Program Files\Internet Explorer\iexplore.exe", $eAssetsearch )
                        GUISetState(@SW_HIDE)
                EndSelect
    WEnd
EndFunc   ;==>Example

 

i ve attached my search result here as well i jus wanted to fetch the state and OS details and write the same in the notepad.

Thanks !

 

 

 

Capture.PNG

Share this post


Link to post
Share on other sites

#6 ·  Posted

Quote

This is my code.

That's the same code as before. So you aren't really logging into the website. Rather, you are just loading the web browser with a predefined URL.

Quote

i ve attached my search result here as well i jus wanted to fetch the state and OS details and write the same in the notepad.

Can't really tell much from the picture. Looks like a table, so you can probably use _IETableGetCollection and _IETableWriteToArray to load it into an array. Then you would use standard Autoit commands to retrieve the desired values from the array.

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