Jump to content

Recommended Posts

Posted

Hi!

I'm trying to make a script that will read URL's and paste them into an excel sheet. I'm almost done, the last hurdle is this:

When using _IELinkGetCollection, it returns the URL's, not the text wich is visible on the website. How do I get the text?

Example; the website shows 1445623 - Speer Werk CV - info@speerwerk.be, but returned is the URL it's linking to. I need the text it self.

Many Thanks!!

Posted

See _IEPropertyGet() where the property is "innertext"

I think it should be something like

$oLinks = _IELinkGetCollection ($oIE)
For $oLink In $oLinks
    MsgBox(0, "Link Info", _IEPropertyGet($oLink, "innertext"))
Next

I could be wrong on this but I'm sure Dale will come along to correct it if I am.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted (edited)

Yes many thanks..

_IEpropertyget does indeed return the text of the previously collected links with _IELinkGetCollection..

I still have a little problem integrating it into my script:

$oLinks = _IELinkGetCollection ($oIE)

$klantmail = _IEPropertyGet($oLinks, "innertext")

Local $iLinkIndex = 15

Local $iCurrentIndex = 0

For $oLink In $klantmail

$iCurrentIndex += 1

If $iCurrentIndex = $iLinkIndex Then

_ExcelWriteCell ($Cleansheet,$klantmail, "D4")

_ExcelBookSaveAs($Cleansheet, "C:\Documents and Settings\Admin\Desktop\Projects\Sheets\ToDo\klant1", "xls")

Endif

ExitLoop

Next

The Idea behind this was that, if $klantmail is the object collection, but with text (btw, whats the difference between an array and an object collection?). Any suggestions?

Thanks!

Unfortunately, this doesn't return anything or writes it to the excel sheet.

Edited by ThomasQ
Posted

What are you attempting to do here? It just doesn't look right but it might be me.

_ExcelWriteCell ($Cleansheet,$klantmail, "D4")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

I'm trying to write the innertext of the Link indexed 15, which I fail to name $Klantmail, to excel sheet D4..

Anyone any ideas whats wrong with my script?

Many Thanks!

Posted

remove the 2 excel functions and put a msg box to verify that $klantmail is OK.

If it is OK then the excel functions are the problem

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
×
×
  • Create New...