Jump to content

find browser with name and do script


Recommended Posts

I have this script and it works by opening the url and then dumping the doc tags and values - but

I want to get it to search for any open browsers (lets make it IE only for now) and ask me to choose which one to work on

this is the scipt below to incorporate it into - I'd appreciate and help with this script - Thanks

#include <IE.au3>
$oIE = _IECreate ("www.google.com")
$oElements = _IETagNameAllGetCollection ($oIE)
$oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = True
$oExcel.Workbooks.add
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 1).Value = "Tag Name"
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 2).Value = "Inner Text"
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 3).Value = "outer Text"
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 4).Value = "outerHTML"
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 5).Value = "uniqueid"
$oExcel.ActiveWorkbook.Sheets(1).Cells(1, 6).Value = "innerHTML"
$RowNumber =2
For $oElement In $oElements
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 1).Value = $oElement.tagname
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 2).Value = $oElement.innerText
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 3).Value = $oElement.outerText
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 4).Value = $oElement.outerHTML
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 5).Value = $oElement.uniqueid
   $oExcel.ActiveWorkbook.Sheets(1).Cells($RowNumber, 6).Value = $oElement.innerHTML
   $RowNumber = $RowNumber + 1
Next
Link to comment
Share on other sites

Well, it's quite hard to inspect each tab or it's just me:

http://social.msdn.microsoft.com/Forums/en...f-c7f8816b9000/

As for the windows, it's possible to enumerate and ask the user with which window to work.

#include <IE.au3>

Dim $avWin
Dim $oIE

While 1
    $avWin = WinList('[CLASS:IEFrame]')
    
    For $i = 1 To $avWin[0][0]
        If MsgBox(0x24, 'Choose window', 'Work with "' & $avWin[$i][0] & '"?') = 6 Then ; Yes
            ExitLoop(2)
        EndIf
    Next
WEnd

;$oIE = _IEAttach($avWin[$i][1], 'hwnd')
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...