Extract multiple correlated tables from PDF, the tables can be related to a text above the table

I have a case where i may have to extract tabular data from multiple table.
for example if the text above the first table is “text1”. then i will have to extract table1;

i’ve tried data scrapping, however i want to extract table data in relation to the above text -“Text1”. is there a way to correlate a text and extract table?

Appreciate your reply.