Acvoin Posted July 2, 2011 Share Posted July 2, 2011 How do i get the HREF property value from the code below: ...code with lots of links... <p id="paragraph"> <a href="http://somesite.com" target="_blank">Link to a site</a> </p> ...code with lots of links... Link to comment Share on other sites More sharing options...
JohnOne Posted July 2, 2011 Share Posted July 2, 2011 Before you go any further, I feel it my duty to point out that that tag has an ID. "<p id="paragraph">" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Acvoin Posted July 2, 2011 Author Share Posted July 2, 2011 If it wasn't for that ID, I wouldn't post the P tag here The questionis how do I use it? Link to comment Share on other sites More sharing options...
monoscout999 Posted July 2, 2011 Share Posted July 2, 2011 I don`t have to much idea, but did you try somethign like this $Your_URL = "put your URL here" $oIE = _IECreate($Your_URL) $Obj = _IEGetObjectById(_$oIE, "paragraph") If is Obj($Obj) then consolewrite($Obj.type&@CRLF) Link to comment Share on other sites More sharing options...
DaleHohm Posted July 2, 2011 Share Posted July 2, 2011 $oP = _IEGetObjById($oIE, "paragraph") $oA = _IETagnameGetCollection($oP, "a", 0) ; scope to what's inside the P, get first A ConsoleWrite($oA.href &@CRLF) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
GEOSoft Posted July 2, 2011 Share Posted July 2, 2011 $sLink = StringRegExpReplace($sPageSource, "(?is).+<p\s*id=.paragraph.>\s*.+?f=\x22(\S+?)\x22\s.+", "$1") 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!" Link to comment Share on other sites More sharing options...
Acvoin Posted July 2, 2011 Author Share Posted July 2, 2011 DaleHohm, thanks a lot, your method works just fine.GEOSoft, way too hardcore But thanks. Link to comment Share on other sites More sharing options...
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