Skip to content

Use SeleniumBase in Jupyter Notebook (vscode) #3857

Open
@RoosterZhao

Description

@RoosterZhao

I want to use SeleniumBase in Jupyter Notebook, but face some errors, please help.

The idea is to firstly create a SB object in a cell, then write my code slowly cell by cell until I finish all the automation I need. After that I can switch to the normal BaseCase mode.
I don't know how others write their automation scripts, it's super hard for me to write blindly, Jupyter Notebook would help me a lot if it works.

The SB class is created to be used with "with" clause.
with below two lines, I got error: '_GeneratorContextManager' object has no attribute 'open'
sb = SB()
sb.open("https://www.google.com")

then I tried another way, but the browser window is closed right after it's opened, the open method gives error: raise NoSuchWindowException("Active window was already closed!")
sb = SB().__enter__()
sb.open("https://www.google.com")

Please suggest a solution to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions