bills4 Posted July 24, 2012 Share Posted July 24, 2012 how can get some text on this code <p>String i want to get<span class="street">String i want to get</span></p> Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 24, 2012 Share Posted July 24, 2012 You can use the _StringBetween() function, like this, #include <String.au3> Local $sString = '<p>String i want to get<span class="street">String i want to get</span></p>', _ $sVar1 = _StringBetween($sString, '<p>', '<span class="street">'), _ $sVar2 = _StringBetween($sString, '<span class="street">', '</span></p>') ConsoleWrite($sVar1[0] & @LF & $sVar2[0] & @LF) Look in the Help File for more info, and another example. bills4 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
jdelaney Posted July 24, 2012 Share Posted July 24, 2012 (edited) if you want to go the xml parsing route, take the string of the xml, and pass it in: $oXML=ObjCreate("Microsoft.XMLDOM") $oXML.LoadXML('<p>String i want to geta<span class="street">String i want to getb</span></p>') $result = $oXML.selectSingleNode('//p') ConsoleWrite ( $result.childNodes.item(0).text & @CRLF) ConsoleWrite ( $result.childNodes.item(1).text & @CRLF) output would be: String i want to geta String i want to getb this works for html as well, but then again, you can use the _IE* functions, and .innertext to do the same Edited July 24, 2012 by jdelaney bills4 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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