3

I have a simple looking table in a pdf file: one column containing company names. I don't know how many there are in each group but groups are separated by a bold line (the lower border of a table).

In Python2.7 I have used pdfminer.HTMLConverter to get HTML from the PDF document.

I need to say how many company names are in each group.

The HTML from the PDF does not include any tags which I associate with HTML tables i.e. < table >, < tr >, < td >.

There is no link to a CSS file. What information is there about the table in the HTML?

  • 1
    This may be appropriate for stack exchange, as they would be able to look at the data. – Daniel Miller Jul 22 '16 at 14:51
  • if you only have 1 pdf and don't need bulk/automation, use tabula for this. seriously, you don't have to think and it just makes life scraping one off pdfs so much better/easier – albert Jul 22 '16 at 15:36
  • I've installed Tabula version 1.0.5 on Python2.7. Any tips or example code? – Astrophe Jul 22 '16 at 17:03
  • sorry for long delay...no tips, just install and run tabula. new tab will open in default browser, select which pdfs you want parsed, then select each one individually for parsing. Tabula has very good table recognition features if you feel like the PDF is formatted well enough. Typically PDFs I get are not, and if the number of data tables are relatively low, I'll manually select them. Once they're selected, tell Tabula to export them, and when its done you'll see the CSV(s) you've created in Tabula browser tab. – albert Mar 14 '18 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.