Giter Site home page Giter Site logo

spider's Introduction

这是什么

  • 知乎
  • 伯乐在线(没有任何反爬,随便玩)
  • 天眼查

具体代码进入 spiders目录下对应的 py 文件

这里数据库采取的 mysql.pipline和 middleware 也都有常用的实现.可以根据自己需求更改一下 setting 文件中的设置

具体一些学习经验可以移步我的博客

知乎

通过 selenuim模拟登陆拿到 cookie, 支持后续页面使用 解决知乎插入数据库的时候主键冲突问题,通过 ON DUPLICATE KEY UPDATE 语句来实现更新 自行配置自己的账号密码

天眼查

这里提供了一个公司的列表文件.通过具体的公司名来进行索引的.你也可以替换成其他的.这里仅供展示

pipline

  • json 本地
  • mysql 异步同步

如果使用数据库,需要setting中配置自己的数据库信息

middleware

  • 随机更换 use_agent
  • 代理
  • selenium 模拟加载 知乎和天眼查均使用了 selenium模拟登陆,需要使用自己的账号密码进行替换

执行

进入main文件中,取消注释具体的行,来执行对应的爬虫,建议 Pycharm 运行

可能的问题

提交 issue 吧

spider's People

Contributors

zjsnowman avatar sirzhangsheng avatar

Watchers

James Cloos 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.