3

I m trying to scrape a pdf file using puppeteer. Upon clicking on the button, it navigates to pdf file, but puppeteer fails to render or it is not able to navigate to the pdf document. The response is null. If headless is false, then pdf renders just fine. Please help me to solve it. I want the PDF to be downloaded when headless is true.

Setting flag always_open_pdf_externally: true did not work as it crashes chromium/chrome

puppeteer.use(require('puppeteer-extra-plugin-user-preferences')({userPrefs: {
  download: {
     prompt_for_download: false,
  },

  plugins: {
    always_open_pdf_externally: true
  }
}}))
Mallikarjun
  • 158
  • 9

0 Answers0