Jump to content
Sign in to follow this  
BreadthFirst

html lists

Recommended Posts

BreadthFirst

Hello everyone. What would be the best way to get elements from ordered/unordered html lists? For instance, how would you extract the text out of the example list shown near the top of: http://www.w3schools.com/html/html_lists.asp ??

Share this post


Link to post
Share on other sites
Glyph

stringregexp function

;Option 1, using offset
$nOffset = 1
While 1
    $array = StringRegExp('<test>a</test> <test>b</test> <test>c</Test>', '<(?i)test>(.*?)</(?i)test>', 1, $nOffset)
    
    If @error = 0 Then
        $nOffset = @extended
    Else
        ExitLoop
    EndIf
    for $i = 0 to UBound($array) - 1
        msgbox(0, "RegExp Test with Option 1 - " & $i, $array[$i])
    Next
WEnd

There are many more examples under the helpfile for this function.

You could first use inetget, then read the saved file using stringregexp.

Or, use _INetGetSource and deviate from writing any files by using only variables.

Edited by Glyph

tolle indicium

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.