The window switching method used is:
handles = self.driver.window_handles self.driver.switch_to.window(handles[1])
reason:
When the action of clicking the link to open a new window has not been completed, the code has already started to perform the action of switching the window, resulting in no list data being obtained.
Solution:
Add a waiting time, wait for the new window to be loaded, and then perform the window switching action.