Hello, currently I’m having troubles understanding how Lua’s string functions work, and how to solve this problem.
function main()
webpage = "[html]
Blah blah blah blah
#
#
[/html]"
--Loop through webpage string and get the text between "
# " and "
" for all cases of "
# " and "
" then get the text between the parentheses in the anchor tag for each case
--Use gsub? string.find?? not sure what to do
end
main()
As you can see I’m trying to loop through the webpage string and get the text between all of the h1 and /h1’s and then use that to get the text in between the parentheses in the anchor tag (the http://www.example.com/test.htm part). You may be asking, what’s the point of narrowing it down to the anchor tag within the h1 tag? Well it’s because in the real webpage I’m using there’s many anchor tags and I only want the url of the ones within the h1 tags.
I’ve looked at some XML parsers for Lua but frankly they seem like overkill for something like this and I’m not even sure if they’re corona supported.
Regards and thanks for any help. [import]uid: 44393 topic_id: 34361 reply_id: 334361[/import]