Scrape title and content with no parent wrapper

I encountered a site similar to this HTML hierarchy:

<h1>Category 1</h1>
<ul>
<li>item a</li>
<li>item b</li>
<li>item c</li>
</ul>
<h1>Category 2</h1>
<ul>
<li>item x</li>
<li>item y</li>
</ul>

I want to transform it into a table like this:

category item
Category 1 item a
Category 1 item b
Category 1 item c
Category 2 item x
Category 2 item y

Because there is no HTML tag that wraps <h1> and <ul>, I can't use the Element selector. Is there any way to scrape this information?

Hi,

Are all elements on the same HTML level? Can you share the URL?