Close the active tab. The active tab is the one currenly controlled by CDP. The active tab MIGHT NOT be the currently visible tab! (If a page opens a new tab, the new tab WON'T be active) To switch the active tab, call: sb.switch_to_tab(tab)
(self)
| 1393 | self.switch_to_tab(-1) |
| 1394 | |
| 1395 | def close_active_tab(self): |
| 1396 | """Close the active tab. |
| 1397 | The active tab is the one currenly controlled by CDP. |
| 1398 | The active tab MIGHT NOT be the currently visible tab! |
| 1399 | (If a page opens a new tab, the new tab WON'T be active) |
| 1400 | To switch the active tab, call: sb.switch_to_tab(tab)""" |
| 1401 | return self.loop.run_until_complete(self.page.close()) |
| 1402 | |
| 1403 | def get_active_tab(self): |
| 1404 | """Return the active tab. |