Python 3.x 使用GUI Python将文件上载到twitter

Python 3.x 使用GUI Python将文件上载到twitter,python-3.x,selenium,automation,ui-automation,Python 3.x,Selenium,Automation,Ui Automation,我尝试使用带有python和selenium的GUI将图像上传到twitter。但是,selenium无法访问机器的对话框来选择我的系统中的文件。如何在文件选择对话框中发送图像路径的键并输入 编辑:我这样做解决了这个问题: import pyautogui #clicking on button pyautogui.write(imagePath) pyautogui.press('enter') 当文件选择对话框出现时

我尝试使用带有python和selenium的GUI将图像上传到twitter。但是,selenium无法访问机器的对话框来选择我的系统中的文件。如何在文件选择对话框中发送图像路径的键并输入

编辑:我这样做解决了这个问题:

import pyautogui

#clicking on button
pyautogui.write(imagePath)
pyautogui.press('enter')
当文件选择对话框出现时