I have a bunch of reports that I'm hand-compiling every day and it's taking forever, so I was thinking of automating the whole process. I will be scraping data from: (1) HTML, (2) CSV/XLS, (3) PDF. I have mainly only scraped data from CSV/HTML with PHP and was wondering if there are any dependable libraries or ways of grabbing table data from a PDF in PHP?
I have also just started learning Python and see that it might be a good idea to try doing this with PDFMiner in conjunction with Scrapy. Would this be better? Or are there other options?
Please let me know. Thanks!
Beautiful Soup is another good alternative for scraping and PDFminer has been the best PDF parser for Python I have found. I use pdf2txt.py mostly and then re-format from there if needed.
If you have command line access to a linux server try the pdftotext command
$ pdftotext file.pdf
If you're lucky you'll get something that you can work with. Depending on the PDF the text may come out weird from the way the tables were originally formatted, in my experience anyway. Good Luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With