Acvoin 0 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... Share this post Link to post Share on other sites
JohnOne 1,603 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. Share this post Link to post Share on other sites
Acvoin 0 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? Share this post Link to post Share on other sites
monoscout999 10 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) Share this post Link to post Share on other sites
DaleHohm 65 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, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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 Share this post Link to post Share on other sites
GEOSoft 67 Posted July 2, 2011 $sLink = StringRegExpReplace($sPageSource, "(?is).+<p\s*id=.paragraph.>\s*.+?f=\x22(\S+?)\x22\s.+", "$1") GeorgeQuestion 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!" Share this post Link to post Share on other sites
Acvoin 0 Posted July 2, 2011 DaleHohm, thanks a lot, your method works just fine.GEOSoft, way too hardcore But thanks. Share this post Link to post Share on other sites