Finding all TR (from html <table>) in [Python]

html-parsing, python, regex

Solution

`findall`

matchObj = re.findall(r'<tr>(.*?)</tr>', txt, re.M|re.I|re.S)

`search` only finds the first one in the given string.

you can read more about the different methods you can use in regex.

however, it looks like you are parsing HTML. why don't you use an HTMl parser?

Problem

I want to get all my that's inside . I wrote this code: ``` matchObj = re.search(r'<tr>(.*?)</tr>', txt, re.M|re.I|re.S) ``` but I only get the first group. how can I get all groups? Thanks in advance :)

Original source