title: Passing cookies to QWebEngineView
body: <p>so I have a python code which converts url to pdf like below</p>
  <pre><code>import sys
  from PyQt5 import QtWidgets, QtWebEngineWidgets
  from PyQt5.QtCore import QUrl, QTimer
  from PyQt5.QtGui import QPageLayout, QPageSize
  from PyQt5.QtWidgets import QApplication
  import argparse
  
  
  
  def _fullScreenRequested(request):
      request.accept()
      loader.showFullScreen()
  
  def main():
      url = ''
      parser = argparse.ArgumentParser(description=&quot;Just an example&quot;, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
      parser.add_argument(&quot;--url&quot;, help=&quot;Type url&quot;)
      args = parser.parse_args()
      config = vars(args)
      url = config['url']
  
  
      app = QtWidgets.QApplication(sys.argv)
      loader = QtWebEngineWidgets.QWebEngineView()
      loader.setZoomFactor(1)
      layout = QPageLayout()
      layout.setPageSize(QPageSize(QPageSize.A4Extra))
      layout.setOrientation(QPageLayout.Portrait)
      loader.load(QUrl(url))
      loader.page().pdfPrintingFinished.connect(lambda *args: QApplication.exit())
  
      def emit_pdf(finished):
          # loader.page().printToPdf(&quot;test.pdf&quot;, pageLayout=layout)
          QTimer.singleShot(2000, lambda: loader.page().printToPdf(&quot;test.pdf&quot;, pageLayout=layout))
  
      loader.loadFinished.connect(emit_pdf)
      sys.exit(app.exec_())
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>I have a cookie.txt with the content below</p>
  <pre><code>    [
      {
          &quot;domain&quot;: &quot;www.udemy.com&quot;,
          &quot;expirationDate&quot;: 1714906174.734258,
          &quot;hostOnly&quot;: true,
          &quot;httpOnly&quot;: false,
          &quot;name&quot;: &quot;snexid&quot;,
          &quot;path&quot;: &quot;/&quot;,
          &quot;sameSite&quot;: null,
          &quot;secure&quot;: false,
          &quot;session&quot;: false,
          &quot;storeId&quot;: null,
          &quot;value&quot;: &quot;c6sdf99-1sdab-4sd1-86ff-2dc8sfs24511&quot;
      }
  ]
  </code></pre>
  <p>is there a way to pass cookie.txt to <code>QWebEngineView</code> or <code>QtWebEngineWidgets</code> ??</p>