Jump to content

_IEGetObjById and _Excel_RangeWrite Help


Recommended Posts

I am trying to pull data from a website and then add it to excel and then loop the code. Before I try and firgure out how to loop the code I am just trying to figure out all the functions I am going to need. 

My problem I don't want it to put [objectHTMLDivElement] I want it to put in the "This is a simple HTML page with text, links and images." 

How would I go about doing that?

 

#include <IE.au3>
#include <Excel.au3>



Excel ()

Func Excel ()

While ProcessExists("EXCEL.EXE")
$ms = MsgBox(5,"","Process error.  You have an Excel sheet open.  You must close it in order to let this program work.  Please close it now.")
    If $ms=2 Then Exit
Sleep(250)
WEnd
   Global $sExcelFile = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "(*.xlsx)")

If FileExists($sExcelFile) Then
   Global $oExcel = _Excel_Open ()
    $oExcel = _Excel_BookOpen($oExcel,$sExcelFile) ;this will open the chosen xls file.

EndIf
EndFunc

Local $oIE = _IE_Example("basic")
Local $oDiv = _IEGetObjById($oIE, "line1")


Sleep (2000)
_Excel_RangeWrite($oExcel,Default, $oDiv, "A3")

 

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

_Excel_RangeWrite($oExcel,Default, $oDiv.innertext, "A3")

You were writing the object to Excel.  The "innertext" of the object is what contains the text you are looking for.  Looks like you used the help file example but modified it.  When you did that and you lost the message box you forgot the reference to innertext. 

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

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