(self, id=None)
| 61 | self.wsurl = resp.json()[0]["webSocketDebuggerUrl"] |
| 62 | |
| 63 | def tab_activate(self, id=None): |
| 64 | if not id: |
| 65 | active_tab = self.tab_list()[0] |
| 66 | id = active_tab.id |
| 67 | self.wsurl = active_tab.webSocketDebuggerUrl |
| 68 | with requests.Session() as session: |
| 69 | resp = session.post( |
| 70 | self.server_addr + self.endpoints["activate"].format(id=id), |
| 71 | headers={"Connection": "close"}, |
| 72 | timeout=2, |
| 73 | ) |
| 74 | return resp.json() |
| 75 | |
| 76 | def tab_list(self): |
| 77 | with requests.Session() as session: |