How can I parse an online PDF file with Python?
I just need the second line of the first page. I need to do this without downloading the file and I am using Python 3.5
I have tried something like this, but it didnt work: Using PDFMiner (Python) with online pdf files. Encode the url?
from pdfminer.pdfparser import PDFParser
import urllib.request
from io import StringIO
import io
url = 'url_with_the_pdf'
open = urllib.request.urlopen(url).read()
memoryFile = io.StringIO(open)
parser = PDFParser(memoryFile)
I get this error:
memoryFile = io.StringIO(open) TypeError: initial_value must be str or None,
not bytes