Can PyQt5 render a page and load dynamic data without access to a physical display?

Context

I am building a web scraper that uses PyQt5 to execute Javascript and get dynamic data. The scraper work well in a physical computer with a Display. I am trying to figure out how to containerize the scraper in Docker for portability and scalability.
Like many others online, I have issues getting PyQt5 to work in the container as it works on a physical machine. After a couple days of research I have learned that it is somewhat difficult to run app depending GUI in docker. The most straightforward approach would be to allow the docker container to use the physical resources (Display) of the host it run in.

Something along the lines of what fadawar is doing here:

docker run -it 
  -v /tmp/.X11-unix:/tmp/.X11-unix 
  -v $(pwd)/test:/app 
  -e DISPLAY=$DISPLAY 
  -u qtuser 
  fadawar/docker-pyqt5 python3 /app/hello.py

Given that a visual check on the QtApplication at work is not required, is there a way with PyQt5 to request and render dynamic data (execute javascript) without attempting to use OS Display resources?

Reproducible sample code:

app.py

import sys
from functools import partial

from PyQt5 import QtCore, QtWebEngineWidgets, QtWidgets


class Signaller(QtCore.QObject):
    emitted = QtCore.pyqtSignal(object)


class PyQtWebClient(QtCore.QObject):
    @QtCore.pyqtSlot(Signaller, str)
    def get(self, signaller, url):
        profile = QtWebEngineWidgets.QWebEngineProfile(self)
        page = QtWebEngineWidgets.QWebEnginePage(profile, self)
        wrapper = partial(self._on_load_finished, signaller)
        page.loadFinished.connect(wrapper)
        page.load(QtCore.QUrl(url))

    @QtCore.pyqtSlot(Signaller, bool)
    def _on_load_finished(self, signaller, ok):
        page = self.sender()
        if not isinstance(page, QtWebEngineWidgets.QWebEnginePage) or not ok:
            signaller.emitted.emit(None)
            return

        html = PyQtWebClient.download_html(page)
        signaller.emitted.emit(html)

        profile = page.profile()
        page.deleteLater()
        profile.deleteLater()

    @staticmethod
    def download_html(page):
        html = ""
        loop = QtCore.QEventLoop()

        def callback(r):
            nonlocal html
            html = r
            loop.quit()

        page.toHtml(callback)
        loop.exec_()
        return html


def callback(event_loop, qt_application, results=None):
    if results is None:
        error = "Did not load"
        print(error)
    else:
        print(results)

    event_loop.quit()
    qt_application.quit()


# main #
qt_app = QtWidgets.QApplication(sys.argv)
client = PyQtWebClient()

url = "https://www.example.com"

signaller = Signaller()
loop = QtCore.QEventLoop()
signaller.emitted.connect(partial(callback, loop, qt_app))
wrapper = partial(client.get, signaller, url)
QtCore.QTimer.singleShot(0, wrapper)
loop.exec_()

qt_app.exec_()

Dockerfile

FROM python:3.7.3

WORKDIR /code

RUN pip install PyQt5==5.11.2

COPY app.py .

CMD ["python", "app.py"]

Source: StackOverflow