【问题标题】:Send Email Using Spidermon and Amazon SES使用 Spidermon 和 Amazon SES 发送电子邮件
【发布时间】:2020-07-23 02:42:10
【问题描述】:

您好,我是 spidermon 的新手,我已阅读文档,但不明白如何发送包含错误消息的相应正文内容的电子邮件。有人可以提供代码吗? 供您参考,我也想添加文档。 https://spidermon.readthedocs.io/

【问题讨论】:

    标签: email scrapy amazon-ses spidermon


    【解决方案1】:

    如文档中所述,您必须在 settings.py 文件中配置电子邮件通知:

    SPIDERMON_AWS_ACCESS_KEY = INSERT_AWS_ACCESS_KEY
    SPIDERMON_AWS_SECRET_KEY = INSERT_AWS_SECRET_KEY
    SPIDERMON_EMAIL_SUBJECT = 'My Crawler Report'  # Or another subject
    SPIDERMON_EMAIL_SENDER = 'myemail@gmail.com'  # your email that will send it
    SPIDERMON_EMAIL_TO = ['...']  # List of emails that will receive the notification
    

    还要确保您的显示器中有SendSESEmail

    例如:

        monitors_finished_actions = [
            SendSESEmail,
        ]
    

    https://spidermon.readthedocs.io/en/latest/actions.html?highlight=email#e-mail-action

    【讨论】:

    • 谢谢 ryan,我昨天找到了。你也可以帮助 AWS 报告吗,我无法上传,我不知道什么是端点访问策略 spidermon。
    猜你喜欢
    • 1970-01-01
    • 2022-01-23
    • 2016-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-19
    • 2012-06-22
    • 2016-08-22
    相关资源
    最近更新 更多