Code Monkey home page Code Monkey logo

jb51.com_crawler's Introduction

爬虫实战:python3.6 + scrapy + mysql爬取 脚本之家

||||||||                                                      |||||||||                              *@*
||        .@@@@   @@ @@@ ,@@@  :@@#@@! @@@    @@@@    @@!@@@  ||         $@            ||  |||  ||   *@*   @@@   @@ @@
||       -@@@@@@  @@@@@@@@@@@: :@@@@@@@@@@@  @@@@@@!  @@@@@@  ||          @ @@@ @@@@@@ ||. ||| .||   *@*  @@-@@  @@@@@
||       @@   @@# @@;  @@  *@@ :@@  @@,  @@ *@@   @@  @@  @@  ||          $@@       @@ .|| ||| ||.   *@* @@   @@ @@@
||       @@   -@@ @@   @@   @@ :@@  @@   @@ @@:   @@  @@  @@  ||          $@#   @@@@@@  || | | ||    *@* @@@@@@@ @@
||       @@   ;@@ @@   @@   @@ :@@  @@   @@ @@$   @@  @@  @@  ||          $@#   @@  @@  || | | ||    *@* @@      @@
||       @@$  @@. @@   @@   @@ :@@  @@   @@ .@@  *@@  @@  @@  ||          $@#   @@  @@   ||| |||     *@* @@      @@
||||||||  @@@@@@  @@   @@   @@ :@@  @@   @@  @@@@@@   @@  @@  |||||||||   $@#   @@@@@@   |||  ||     *@*  @@@@@  @@

[介绍文档]

    python版本:python3.6
    scrapy: 1.5.0
    需要安装pymysql包支持访问mysql数据库
    可以使用pip安装: pip install pymysql

重要提示

*或者按照下述方法执行一键安装依赖:pip install -r requirements.txt

*重要事情说三遍:请确保你安装了mysql数据库! 请确保你安装了mysql数据库! 请确保你安装了mysql数据库!

*所有平台的Mysql下载地址为: https://dev.mysql.com/downloads/挑选你需要的 MySQL Community Server 版本及对应的平台。

爬虫工作配置

  • 第一步:下载github项目文件
git clone [email protected]:caffreycc/jb51.com_crawler.git

或者直接到https://github.com/caffreycc/jb51.com_crawler.git 下载zip文件
  • 第二步:安装依赖:
pip install -r requirements.txt
  • 第三步:修改配置Config.py:
    Config.py 为项目配置文件

    host = '127.0.0.1' #改成你的数据库地址,如果需要保存在线服务器请填写数据库IP
    dbname = 'your database naem'  # 数据库名字,请修改
    user = 'your databse user'  # 数据库账号,请修改
    psw = 'your password'  # 数据库密码,请修改
    port = 3306  # 数据库端口,在dbhelper中使用,一般无需修改
  • 第四步:运行小爬虫
    命令行cd到你的项目文件夹,运行以下命令:
    或者直接在你的爬虫文件夹内shift + 右键 打开命令提示符或者powershell,运行以下命令
    scrapy crawl Common_crawler

    爬取的内容会自动保存到 config.py 中配置的mysql数据库中

问题反馈

  有任何关于项目的问题欢迎提issues

贡献代码

本项目基于PythonCrawler-Scrapy-Mysql-File-Template开发,感谢作者@lawlite19(https://github.com/lawlite19)的开源分享精神。

jb51.com_crawler's People

Contributors

caffreycc 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.