我想寫一個程序,可以從我的雅虎電子郵件帳戶保存最新的10個郵件文本給雅虎的用戶名和PWD 文件。編程雅虎郵箱導航
我試着使用python 即=調度( 「InternetExplorer.Application」)
我能夠登入,但不能使用 ie.document.getElementsByName(」「) ie.document.getElementsById (」「) 閱讀電子郵件
什麼建議嗎?
謝謝。
我想寫一個程序,可以從我的雅虎電子郵件帳戶保存最新的10個郵件文本給雅虎的用戶名和PWD 文件。編程雅虎郵箱導航
我試着使用python 即=調度( 「InternetExplorer.Application」)
我能夠登入,但不能使用 ie.document.getElementsByName(」「) ie.document.getElementsById (」「) 閱讀電子郵件
什麼建議嗎?
謝謝。
使用POP3/IMAP做這件事不容易嗎?只需獲取最後10封郵件並離開服務器?
這樣你就不依賴於雅虎網站。 (如果它改變你的代碼將會因爲依賴於UI而中斷)。
可以通過發出一個非標準ID(「GUID」,「1」)命令訪問通過IMAP 基本Yahoo帳戶。 下面的代碼說明了這打印出所有的新郵件的消息ID:
require 'net/imap'
Net::IMAP.debug = true
conn = Net::IMAP.new('imap.mail.yahoo.com', 143, false)
conn.instance_eval { send_command('ID ("GUID" "1")') }
conn.authenticate('LOGIN', ARGV[0], ARGV[1])
conn.select("INBOX")
uids = conn.uid_search(['NEW'])
puts uids.join(',')
conn.logout
conn.disconnect
要知道,有在紅寶石的淨/ imap的庫中的缺陷。 你需要把這裏引用的補丁:
只有雅虎郵件以及可以訪問POP3/IMAP。 我正在使用雅虎郵件基本帳戶。 – user240709 2010-01-20 05:54:06