Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headless=False in is_docker() mode #106

Open
megapegabot opened this issue Apr 30, 2024 · 1 comment
Open

headless=False in is_docker() mode #106

megapegabot opened this issue Apr 30, 2024 · 1 comment

Comments

@megapegabot
Copy link

megapegabot commented Apr 30, 2024

I think I need to add here:

def create_options_and_driver_attributes_and_close_proxy(.....,headless):
        ......
        elif is_docker():
            options.add_argument('--no-sandbox')
            if headless:
                options.add_argument('--headless=new') 
            # options.add_argument('--disable-setuid-sandbox')

I needed it, I had to fork it. or add an additional variable to solve this problem

there is also a problem with this part

#download_driver.py

def recreate_build_dir():
   ......
    # Delete the build directory
    shutil.rmtree(build_dir, ignore_errors=True)

    # Create the build directory again
    os.makedirs(build_dir)

if build_dir is mounted in docker like: docker run ... -v ./build:/botasaurus_project/build
docker sets a flag that prevents the directory from being deleted. And I get an error:

 FileExistsError: [Errno 17] File exists: '/botasaurus_project/build'

and it would also be nice to add 2 variables, something like --del-run-args which remove hard-coded arguments from the final run command. Аnd a second command --add-run-args which can add to the run line for example " --use-angle=vulkan --enable-features=Vulkan --disable-vulkan-surface --enable-unsafe-webgpu"

@Chetan11-dev
Copy link
Contributor

We have dropped selenium support, and instead gone with our custom driver, so build issues should not occur.

And, I am not sure, how can we use headfull mode in docker,could you share example dockerfile?

You can use add_argument function to add more arguments, although you can't delete existing one's. I don't think there is a good usecase for it.

Also, We have released v4, which solves many bugs and adds awesome feautres like UI Run. I suggest learning about it, to do so, please run the following commands:

python -m pip install bota botasaurus_api botasaurus_driver bota botasaurus-proxy-authentication botasaurus_server --upgrade

Then read the documentation at https://github.com/omkarcloud/botasaurus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants