I'm trying to scrape a table, and whoever set this up to put a bunch of information in a 1 column table, and inside each row, there are many rows.
I'd like to grab each for from inside the row and create a data frame with that as a row. I'd also like to set the information located in <strong> </strong> as a column for the entire data frame.
Is there a way to do this with python? I've been working with selenium and pandas read_html, but I think I've run into a wall here. Ultimately, I would like to concat all of this information together into a data frame.
The HTML looks like this.
<td>
<strong> Important Information1 </strong>
<br> Some information
<br> Some information
<br> Some information
<br> Some information
<br> Some information
<br> Some information
</td>
<td>
<strong> Important Information 2 </strong>
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
<br> Some information 2
</td>
<td>
<strong> Important Information 3 </strong>
<br> Some information 3
<br> Some information 3
<br> Some information 3
<br> Some information 3
</td>
Expected Outcome:
Important Header Some Information Header
0 Important Information1 Some information
1 Important Information1 Some information
2 Important Information1 Some information
3 Important Information1 Some information
4 Important Information1 Some information
5 Important Information1 Some information
6 Important Information2 Some information 2
7 Important Information2 Some information 2
8 Important Information2 Some information 2
9 Important Information2 Some information 2
10 Important Information2 Some information 2
11 Important Information2 Some information 2
12 Important Information2 Some information 2
13 Important Information2 Some information 2
14 Important Information2 Some information 2
15 Important Information2 Some information 2
16 Important Information3 Some information 3
17 Important Information3 Some information 3
18 Important Information3 Some information 3
19 Important Information3 Some information 3