Code example to search for html <div> tag:
index = html.search(/<div>|<div .*>/i);
As you can see it also searches for anything inside the div tag; e.g., <div style=“color:#00FF00”>
Any recommendations how to find the length of the search result? For example <div> is 5 characters, while <div style=“color:#00FF00”> is 27 characters.
The only way I know how to do it is with two searches. The above search, then search for the ending > character to get the length.
Thanks,
Paul