Code Monkey home page Code Monkey logo

python-'s Introduction

python爬虫程序

python+mysql
autodownloadnews用于抓取百度热门新闻并存放进数据库中
send_email用于从数据库抓取新闻并制作成html文件,发送到指定邮箱
auto_send用于定时执行上面的两个程序,从而实现自动化
抓取使用了selenium包,因为百度首页使用了ajax来局部更新,使用selenium来模拟用户操作,获取局部更新的内容。文件的内容是我预先浏览过的,所以用写死的xpath来进行查找
发送邮件的时候使用了email包,用email里的mimetext方法把从mysql里提取出来的内容写成html,然后用到stmplib包进行发送,注意邮箱账户需要预先开通stmp功能。
自动化用了简单的while循环不断检查是否到达了指定时间,使用sleep来避免过于频繁的检查

python-'s People

Contributors

zliubz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.