Jump to content

Search the Community

Showing results for tags '_stringbetween()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I'm having trouble trying to collect data that's inside an html tag, I haven't found a solution to it yet. If you have ideas please help. Thank you Script: #include <String.au3> Global $HTML_Test $HTML_Test &= '<div class="accordion-item">' & @CRLF ; <!---- START GET--> $HTML_Test &= ' <div class="accordion-inner">' & @CRLF $HTML_Test &= ' <p>Khoá an toàn giúp bếp luôn được an toàn</p>' & @CRLF $HTML_Test &= ' </div>' & @CRLF $HTML_Test &= ' <a href="#" class="accordion-title plain">' & @CRLF $HTML_Test &= ' <button class="toggle">' & @CRLF $HTML_Test &= ' <i class="icon-angle-down"></i>' & @CRLF $HTML_Test &= ' </button>' & @CRLF $HTML_Test &= ' <span>Khoá an toàn</span>' & @CRLF $HTML_Test &= ' </a>' & @CRLF $HTML_Test &= '</div>' & @CRLF ;<!---- END GET --> Global $aSearch = _StringBetween($HTML_Test, '<div class="accordion-item">', '</div>') If IsArray($aSearch) Then For $i = 0 To UBound($aSearch) - 1 ConsoleWrite('!-> SB Return: ' & $aSearch[$i] & @CRLF) Next Else ConsoleWrite('! SB: No strings found. ' & @CRLF) EndIf Unexpected output: <div class="accordion-inner"> <p>Khoá an toàn giúp bếp luôn được an toàn</p> Input: <div class="accordion-item"> <div class="accordion-inner"> <p>Khoá an toàn giúp bếp luôn được an toàn</p> </div> <a href="#" class="accordion-title plain"> <button class="toggle"> <i class="icon-angle-down"></i> </button> <span>Khoá an toàn</span> </a> </div> Desired output: <div class="accordion-inner"> <p>Khoá an toàn giúp bếp luôn được an toàn</p> </div> <a href="#" class="accordion-title plain"> <button class="toggle"> <i class="icon-angle-down"></i> </button> <span>Khoá an toàn</span> </a>
  2. I would like to take String Between of the text, on starting point and end point found. #include <String.au3> Local $begin = "((" Local $end = "))" Local $loop = 0 For $i = 1 To 2 While 1 $loop += 1 $begin &= "(" If $loop = $i Then ExitLoop WEnd $loop = 0 While 1 $loop += 1 $end &= ")" If $loop = $i Then ExitLoop WEnd Local $keyS = "#", $keyE = "@" Local $0 = "A))" & $begin & $keyS & "(" & $end & $begin & $begin & "C" & $end & $begin & $end & ")" & $keyE & $end & "(((B" Local $A = _StringBetween($0, $keyS, $keyE) Local $C = $keyS & $A[0] & $keyE Local $B = _StringBetween($0, $begin, $end) Local $D = $B[0] ConsoleWrite("!-IN: " & $0 & @CRLF) ConsoleWrite("String Between: " & $begin & " <with> " & $end & @CRLF) If $C = $D Then ConsoleWrite("+OUT OK: " & $D & @CRLF & @CRLF) Else ConsoleWrite("- True result: " & $C & @CRLF) ConsoleWrite("! But OUT: " & $D & @CRLF & @CRLF) EndIf Next Local $begin = "((" Local $end = ")))" Local $loop = 0 For $i = 1 To 2 While 1 $loop += 1 $begin &= "(" If $loop = $i Then ExitLoop WEnd $loop = 0 While 1 $loop += 1 $end &= ")" If $loop = $i Then ExitLoop WEnd Local $keyS = "#", $keyE = "@" Local $0 = "A))" & $begin & $keyS & "(" & $end & $begin & $begin & "C" & $end & $begin & $end & ")" & $keyE & $end & "(((B" Local $A = _StringBetween($0, $keyS, $keyE) Local $C = $keyS & $A[0] & $keyE Local $B = _StringBetween($0, $begin, $end) Local $D = $B[0] ConsoleWrite("!-IN: " & $0 & @CRLF) ConsoleWrite("String Between: " & $begin & " <with> " & $end & @CRLF) If $C = $D Then ConsoleWrite("+OUT OK: " & $D & @CRLF & @CRLF) Else ConsoleWrite("- True result: " & $C & @CRLF) ConsoleWrite("! But OUT: " & $D & @CRLF & @CRLF) EndIf Next Local $begin = "(((" Local $end = ")" Local $loop = 0 For $i = 1 To 2 While 1 $loop += 1 $begin &= "(" If $loop = $i Then ExitLoop WEnd $loop = 0 While 1 $loop += 1 $end &= ")" If $loop = $i Then ExitLoop WEnd Local $keyS = "#", $keyE = "@" Local $0 = "A))" & $begin & $keyS & $end & "(" & $begin & $begin & "C" & $end & $begin & $end & ")" & $keyE & $end & "(((B" Local $A = _StringBetween($0, $keyS, $keyE) Local $C = $keyS & $A[0] & $keyE Local $B = _StringBetween($0, $begin, $end) Local $D = $B[0] ConsoleWrite("!-IN: " & $0 & @CRLF) ConsoleWrite("String Between: " & $begin & " <with> " & $end & @CRLF) If $C = $D Then ConsoleWrite("+OUT OK: " & $D & @CRLF & @CRLF) Else ConsoleWrite("- True result: " & $C & @CRLF) ConsoleWrite("! But OUT: " & $D & @CRLF & @CRLF) EndIf Next
×
×
  • Create New...