1

Ubuntu version : 18.04.5 and without gui
chrome version : 110.0.5481.177
I want : Using chrome to crawling with Selenium(python)
But, If I crawl to the site where I have to crawl, An error message occurs like below


Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card.
For more help, please click this link.
Check out some of the following links to learn more about WebGL and to find more web applications using WebGL.

WebGL Wiki
Want more information about WebGL?

khronos.org/webgl
Hosted by Digital Ocean

And, When I approach chrome://gpu through the selenium, the following error message appears.

Graphics Feature Status
Canvas: Software only. Hardware acceleration disabled
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Software only. Hardware acceleration disabled
Multiple Raster Threads: Enabled
OpenGL: Disabled
Rasterization: Software only. Hardware acceleration disabled
Raw Draw: Disabled
Video Decode: Software only. Hardware acceleration disabled
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Disabled
WebGL2: Disabled
WebGPU: Disabled
Problems Detected
WebGPU has been disabled via blocklist or the command line.
Disabled Features: webgpu
Accelerated video encode has been disabled, either via blocklist, about:flags or the command line.
Disabled Features: video_encode
Gpu compositing has been disabled, either via blocklist, about:flags or the command line. The browser will fall back to software compositing and hardware acceleration will be unavailable.
Disabled Features: gpu_compositing
Version Information
Data exported
2023-03-07T05:13:27.125Z
Chrome version
HeadlessChrome/110.0.5481.177
Operating system
Linux 4.15.0-163-generic
Software rendering list URL
https://chromium.googlesource.com/chromium/src/+/f34f7ab2d4ca4ad498ef42aeba4f4eb2c1392d63/gpu/config/software_rendering_list.json
...

After observing the above two error messages, I think it is a 'Hardware acceleration' and 'webgl' problem.

So, I have tried to enable 'Hardware acceleration' and 'webgl' several times, but it does not work. Below is the method I tried.

vi /usr/share/applications/google-chrome.desktop
after edit
from Exec=/opt/google/chrome/google-chrome-stable %U
to Exec=/opt/google/chrome/google-chrome-stable -–ignore-gpu-blacklist –-enable-webgl -–flag-switches-begin –flag-switches-end %U etc..
(I think it might not have been applied because I don't know how to restart Chrome in a Linux environment.)

Thanks for reading

jinu
  • 11
  • 3

1 Answers1

1

To make sure your arguments get passed correctly, try using the following script:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("-–ignore-gpu-blacklist")
options.add_argument("–-enable-webgl")
options.add_argument("--disable-gpu")
driver = webdriver.Chrome(chrome_options=options)

If this still doesn't work, feel free to comment, and I'll edit my answer.

resource

kaliiiiiiiii
  • 925
  • 1
  • 2
  • 21
  • Thank you for comment kali. But, I already try that.. I think 'hardware acceleration' problem. – jinu Mar 08 '23 at 08:06
  • Did you try with adding `--disable-gpu` (additional to my code above, edited) ? This should make it use software rendering then. – kaliiiiiiiii Mar 08 '23 at 09:09
  • Also, are you running on headless? And if yes, what code do you use to do so? – kaliiiiiiiii Mar 08 '23 at 09:56
  • `--headless`, `--no-sandbox`, `--use-gl=egl`, `--enable-gpu-rasterization` etc.. and your advice. But, it dont change – jinu Mar 08 '23 at 11:00