DEV Community

Discussion on: Automate your web pages with "webbot 🤖" without much code 🚀🔥

Collapse
 
lizard profile image
Lizard • Edited

Opening new tabs doesn't work for me.

Edit: fixed it already. Added this code to the class in webbot.py

def new_tab(self, url):
        self.driver.execute_script(f"window.open('');") ;
        new_tab_position = self.get_total_tabs()
        self.switch_to_tab(new_tab_position)
        self.go_to(url)