import os
import sys
import selenium
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Firefox()
type(browser)
Get_webpage=browser.get('https://accounts.google.com/ServiceLogin?sacu=1&scc=1&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&hl=en&service=mail#identifier')
user_name = browser.find_element_by_id('Email')
user_name.send_keys("username")#Enter your username
time.sleep(2)
next = browser.find_element_by_id('next')
next.submit()
time.sleep(5)
password = browser.find_element_by_id('Passwd')
password.send_keys("password")#enter your password
password.submit()
time.sleep(5)
compose = browser.find_element_by_xpath("//div[@role='button']")
compose.click()
time.sleep(5)
Attach_file = browser.find_element_by_xpath("//div[@role='button']")
Gmail에 로그인 할 수 있었지만 메일을 작성할 수 있었지만 파일을 첨부 할 수 없었습니다. 누구나 파일 첨부 방법을 제안 할 수 있습니까? 셀렌으로 가능합니까, 아니면해야합니까? pyautoit 모듈을 사용 하시겠습니까?pyautoit 모듈을 사용하여 파일을 Gmail에 첨부 할 수 있습니까?
셀렌을 사용하려는 시도를 존중하지만, 왜 Google API를 사용하지 않습니까? https://developers.google.com/gmail/api/ – RobertB
Google api를 사용할 수 있는지 알지 못했습니다. 우편물을 보내는 동안 첨부 파일을 어떻게 사용할 수 있는지 안내해 주시겠습니까? 제발 자바가 아닌 파이썬을 사용하여 자동화 할 필요가 없습니다. – Sai
내가 게시 한 링크에는 가이드, 샘플 및 많은 설명서가 있습니다. 가이드에는 심지어 파이썬 예제가 있습니다. "첨부 파일 업로드하기"에 대한 안내서도 있습니다. 그래서 나는 당신이 읽고 배우는 것만으로 생각합니다. – RobertB