I recently ran into a problem when trying to scroll websites on a server without GUI, the problem is I can't use ('--headless') option to be able to complete my tests, so I try to open Xvfb fake window not to use this ('--headless') option. Strange thing is that my program works on my local computer with GUI, but when I try to start it from a headless server it will stop when creating chromedriver ( uc.Chrome() ) and will only work with the extra ('--headless') option, that I don't want to use. Is there any solution to this? My program is as following
import undetected_chromedriver as uc
from xvfbwrapper import Xvfb
vdisplay = Xvfb(width=1280, height=740, colordepth=16)
vdisplay.start()
options = uc.ChromeOptions()
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_argument('--incognito')
options.add_argument('--no-default-browser-check')
options.add_argument('--no-first-run')
#program stops here
driver = uc.Chrome(options=options)