如何在 pyautogui 中打开 chrome 个新标签页。我没有收到任何错误,但代码不工作

How to open chrome new tab in pyautogui. i am not getting any error but code is not working

我正在将 Whatsapp 联系人保存到 sheets.google.com。我正在使用 new_tab = pyautogui.locateCenterOnScreen('btn.png') 和 pyautogui.click(new_tab) 打开一个新标签。但它没有点击那个按钮我没有收到任何错误如何修复!!

我的代码:

import pyautogui    

new_tab = pyautogui.locateCenterOnScreen('btn.png')
pyautogui.click(new_tab)

试试这个

new_tab= pyautogui.locateOnScreen('btn.png', confidence=.6)
        pyautogui.moveTo(new_tab[0], new_tab[1], duration=self.speed)
        pyautogui.click(interval=self.click_speed)

可以工作