0

I have the following example html code below. I would like to have a dataframe as follows. Thank you very much for any ideas

<a name="efficiant"></a><h3>Ingredient</h3>
<div id="product_detail"><ul>
<li>X1<ul>
<li>a</li>
<li>b</li>
<li>c</li>
</ul>
</li>
<li>X2<ul>
<li>a</li>
<li>b</li>
</ul>
</li>
<li>X3<ul>
<li>c</li>
<li>b</li>
</ul>
</li>
</ul>
</div>


column A    column B
   X1          a
   X1          b
   X1          c
   X2          a
   X2          b
   X3          c
   X3          b 
Arun kumar mahesh
  • 2,080
  • 1
  • 9
  • 17
jblackt
  • 43
  • 4
  • @RajithThennakoon I don't think there is anything wrong with the html. It's a nested `ul` structure within a `li` structure. You should be able to extract relevant bits using `rvest` and suitable CSS selectors. – Maurits Evers Nov 24 '19 at 13:09