I used chrome to convert a webpage into Pdf using save as pdf option. Now the problem is that when I extract the data from it using PyPDF2, it shows Null whereas it works on oth
PyPDF2 is highly unreliable for extracting text from pdf . as pointed out here too. it says :
While PyPDF2 has .extractText(), which can be used on its page objects (not shown in this example), it does not work very well. Some PDFs will return text and some will return an empty string. When you want to extract text from a PDF, you should check out the PDFMiner project instead. PDFMiner is much more robust and was specifically designed for extracting text from PDFs.
You could instead install and use pdfminer using
pip install pdfminer
or you can use another open source utility named pdftotext
by xpdfreader. instructions to use the utility is given on the page.
you can download the command line tools from here
and could use the pdftotext.exe utility using subprocess
.detailed explanation for using subprocess is given here