Klexen Posted September 18, 2009 Posted September 18, 2009 (edited) I know how to get links by id, using _IEGetObjById. Is it possible to get link by class? If not, does anyone have an idea, on how I would get all the links from source code that start with <h3 class=r> Below is a link that I would like to extract... I copied this from random google search source code viewing. I noticed all the links that I want start with <h3 class=r><a href=" etc.. I just want the href link. Any ideas? <h3 class=r><a href="http://www.webhostingtalk.com/profile/bob0rz" class=l onmousedown="return clk(this.href,'','','res','3','&sig2=qn6aB3jIlKlDdPPFJ_b5YQ')"> Using _StringBetween('<h3 class=r><a href="http://www.webhostingtalk.com/profile/bob0rz"', '"', '"') That would give me what I want... But how do I pull all the links that start <h3 class=r><a href="www.whatever.com" etc....> from the source code? Edited September 18, 2009 by Klexen
PsaltyDS Posted September 19, 2009 Posted September 19, 2009 I know how to get links by id, using _IEGetObjById. Is it possible to get link by class? If not, does anyone have an idea, on how I would get all the links from source code that start with <h3 class=r> Below is a link that I would like to extract... I copied this from random google search source code viewing. I noticed all the links that I want start with <h3 class=r><a href=" etc.. I just want the href link. Any ideas? <h3 class=r><a href="http://www.webhostingtalk.com/profile/bob0rz" class=l onmousedown="return clk(this.href,'','','res','3','&sig2=qn6aB3jIlKlDdPPFJ_b5YQ')"> Using _StringBetween('<h3 class=r><a href="http://www.webhostingtalk.com/profile/bob0rz"', '"', '"') That would give me what I want... But how do I pull all the links that start <h3 class=r><a href="www.whatever.com" etc....> from the source code? That's a heading tag (level 3) and the link is a child element of the heading. You can get a collection of all links with _IELinkGetCollection() and loop through the links testing $oLink.ParentNode.Class == "r". Or, the other way around, get a collection of all h3 tags with _IETagNameGetCollection() and check each one for its first child link with $oH3.FirstChild Neither tested, but I think it should help. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Klexen Posted September 19, 2009 Author Posted September 19, 2009 (edited) Thanks man! I will definitely try this out and post feedback. Edited September 19, 2009 by Klexen
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now