Skip to content

Can pdfplumber read URLs? #913

Answered by petermr
petermr asked this question in Q&A
Discussion options

You must be logged in to vote

It seems to work:

    def test_read_urls(self):
        url = "https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_SPM.pdf"
        response = requests.get(url)
        bytes_io = BytesIO(response.content)
        with pdfplumber.open(bytes_io) as f:
            pages = f.pages
            assert len(pages) == 40

I don't know whether this scales to very large PDFs and whether there are buffering issues, but this may be useful for others.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by petermr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant