Scraping a site with pages with unhelpful structure!

Hi,

I have a page where the structure is:

div
h3
ul
li /li
. . .
/ul
h3
ul
li /li
. . .
li /li
/ul
/div

The number of li in any ul is unknown (there could be 1 or 10!)

What I want is to create a table that looks like the following

First h3 li(1)
First h3 li(2)
First h3 li(n)
Second h3 li(1)
Second h3 li(2)
Second h3 li(n)

and so on. How do I achieve this, please?

Thanks in advance.