r/pythontips • u/InterestingBig5702 • Jun 24 '24
Syntax Scraping data from scanned pdf
Hi guys, if you can help me out, I am stuck in a project where I have to scrape the data out of a scanned pdf and the data is very unorganised contained in various boxes inside the pdf, the thing is I need the the data with the following headings which is proving to be very difficult
6
Upvotes
7
u/ironman_gujju Jun 25 '24
OCR will work for these things
3
u/AdviceWalker420 Jun 25 '24
Hey brother check out unstructurd - I often use that along with GPT API to help parse really unstructured data. Depends on your use case though! Good luck!
2
u/BallumSkillz Jun 24 '24
What library are you using for scraping? PYPDF?
9
u/ambidx Dec 16 '25
been there, those pdfs feel like a puzzle. Try getting a good text dump first, then reorganize. Lido gave me way less scrambled output than the standard tools, so sorting into headings got easier.
1
u/Usual_Office_1740 Jun 25 '24
You should be aware that scanned pdf's are not actually pdf's inside. They are an image encoded into a pdf. It is still possible to parse a scanned pdf. A large number of pdf parsing python libraries won't work, though.
1
u/lordeatonbutt Jun 25 '24
Melissa Dell and collaborators have developed a library called layoutparser, which greatly helps for tables, etc.
https://layout-parser.github.io/
1
u/magandangkawani Aug 05 '24
You may use pdfplumber library as well