当前位置:网站首页>Use the scrapy to climb to save data to mysql to prevent repetition
Use the scrapy to climb to save data to mysql to prevent repetition
2022-08-02 09:21:00 【51CTO】
1.环境建立
1.使用xmapp安装php, mysql ,phpmyadmin
2.安装python3,pip
3.安装pymysql
3.(windows 略)我这边是mac,安装brew,用brew 安装scrapy
2.整个流程
1. 创建数据库和数据库表,准备保存
2.write crawler targetURL,进行网络请求
3.Process the crawl return data,得到具体数据
4.For specific data saved to the database
2.1.创建数据库
First create a database called scrapy,然后创建一个表article,我们这里给body加了唯一索引,防止重复插入数据
It's like this after it's done.
2.2 Let's first look at the structure of the entire crawler project
quotes_spider.py是核心,Responsible for processing network requests and content,Then throw the sorted contentpipelines进行具体处理,保存到数据库中,This will not affect the speed.
其他的看 图说明
2.2 write crawler targetURL,进行网络请求
start_requests Is to write the specific to climbURL
parseIt is the core where the returned data is processed,然后以item的形式抛出,Next, define the next content to crawl
2.3 items
2.4 pipelines
2.5 配置
边栏推荐
猜你喜欢

Spend 2 hours a day to make up for Tencent T8, play 688 pages of SSM framework and Redis, and successfully land on Meituan

AlterNET Studio用户界面设计功能扩展

二维数组零碎知识梳理

Jenkins--基础--5.4--系统配置--全局工具配置

裁员趋势下的大厂面试:“字节跳动”

新起点丨MeterSphere开源持续测试平台v2.0发布

Bigder:41/100生产bug有哪些分类

The packet capture tool Charles modifies the Response step

边缘计算开源项目概述

数据库mysql
随机推荐
百战RHCE(第四十七战:运维工程师必会技-Ansible学习2-Ansible安装配置练习环境)
Bigder:41/100生产bug有哪些分类
主流监控系统工具选型及落地场景参考
What attributes and methods are available for page directives in JSP pages?
The packet capture tool Charles modifies the Response step
Rust from entry to master 03-helloworld
Daily practice of dynamic programming (3)
Docker内MySQL主从复制学习,以及遇到的一些问题
【SeaTunnel】从一个数据集成组件演化成企业级的服务
大厂外包,值得拥有吗?
openpyxl 单元格合并
动态规划每日一练(2)
腾讯T8架构师,教你学中小研发团队架构实践PDF,高级架构师捷径
PyCharm usage tutorial (detailed version - graphic and text combination)
Jenkins--基础--6.1--Pipeline--介绍
曲折的tensorflow安装过程(Tensorflow 安装问题的解决)
用汇编实现爱心特效【七夕来袭】
AutoJs学习-存款计算器
2022牛客暑期多校训练营4(ADHKLMN)
Have you ever learned about these architecture designs and architecture knowledge systems?(Architecture book recommendation)

