0

I built a website capture tool that uses Selenium and Chrome / Firefox / Edge drivers. The problem is that when I try to capture a page with a html5 video with the Chrome drive (latest version), the background of the video is blank, whereas when I try with Firefox / Edge, everything is ok.

As far as I can see in the HTML the video does not have anything special about it:

<video id="hero_demo_vid" muted="" autoplay="" loop="" src="/somevideomp4"></video>

I have already tested with multiple sites and I have the same results. Also, I have all the possible codecs installed on the server. I tried a ton of variations ... but just to show the last ones that I am using:

RUN apt-get install -y ffmpeg
RUN apt-get install -y gstreamer1.0-libav
RUN apt-get install -y gstreamer1.0-plugins-base
RUN apt-get install -y gstreamer1.0-plugins-good
RUN apt-get install -y gstreamer1.0-plugins-bad
RUN apt-get install -y gstreamer1.0-plugins-ugly
RUN apt-get install -y libgstreamer1.0-0
RUN apt-get install -y libgconf-2-4
RUN apt-get install -y libfontconfig1

Also, I ma using different options for chrome. Right now this is my latest config, but I have been switching the options a lot over the last couple of days, with no luck:

    options.add_argument(f'user-agent={user_agent}')
    options.add_argument('--single-process')
    options.add_argument('--allow-running-insecure-content')
    options.add_argument('--ignore-certificate-errors')
    options.add_argument('--window-size=1400,1080')
    options.add_argument('--disable-cache')

    if self._browser_name != 'chrome':
        options.add_argument('--disable-gpu')
        options.add_argument('--page_load_strategy=normal')
    else:
        options.add_argument('--page_load_strategy=eager')
        options.add_argument('--autoplay-policy=no-user-gesture-required')
        options.add_argument('--use-fake-ui-for-media-stream')
        options.add_argument('--disable-setuid-sandbox')
        options.add_argument('--enable-logging')
        options.add_argument('--v=1')

    options.headless = True
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage')

Does anybody have any idea what could this be? I am loosing my mind ...

0