python windows 安装scrapy_Windows下安装Scrapy

这几天正好有需求实现一个爬虫程序,想到爬虫程序立马就想到了python,python相关的爬虫资料好像也特别多。于是就决定用python来实现爬虫程序了,正好发现了python有一个开源库scrapy,正是用来实现爬虫框架的,于是果断采用这个实现。下面就先安装scrapy,决定在windows下面安装。

Scrapy简介

Scrapy,Python开发的一个快速、高层次的屏幕抓取和web抓取框架,用于抓取web站点并从页面中提取结构化的数据。

Scrapy用途广泛,可以用于数据挖掘、监测和自动化测试。

Scrapy吸引人的地方在于它是一个框架,任何人都可以根据需求方便的修改。它也提供了多种类型爬虫的基类,如BaseSpider、sitemap爬虫等,最新版本又提供了web2.0爬虫的支持。

安装依赖 Scrapy安装依赖于以下几个Python库 lxml, an efficient XML and HTML parser parsel, an HTML/XML data extraction library written on top of lxml, w3lib, a multi-purpose helper for dealing with URLs and web page encodings twisted, an asynchronous networking framework cryptography and pyOpenSSL, to deal with various network-level security needs

我选择手动安装这些依赖 pip install lxml pip install parsel pip install w3lib pip install twisted pip install cryptography pip install pyOpenSSL

其他的安装都很顺利,就是在安装twisted的时候报错了。 Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools

于是下载离线的安装(下载自己的版本)

https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

下载到一个目录,然后用

pip install Twisted-17.9.0-cp36-cp36m-win32.whl

然后使用以下命令安装它。

[En]

Then use the following command to install it.

pip install Scrapy

在命令行中输入scrapy,出现如下界面,则表示安装成功

python windows 安装scrapy_Windows下安装Scrapy

总结

以上就是本文的全部内容。希望本文的内容对您的学习或工作有一定的参考和学习价值。感谢您对聚美学院的支持。如果您想了解更多信息,请查看下面的相关链接。

[En]

The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for your study or work. Thank you for your support to Jumi College. If you want to know more about it, please see the relevant links below.

Original: https://blog.csdn.net/weixin_39678304/article/details/113640246
Author: weixin_39678304
Title: python windows 安装scrapy_Windows下安装Scrapy



相关阅读

Title: numpy 读写 npy npz 文件

文章目录

*
创建数组
保存单个数组
读取单个数组
创建第二个数组
保存多个数组
读取多个数组

import numpy as np

创建数组

a1 = np.arange(0,12).reshape(2,2,3)
a1

array([[[ 0, 1, 2],
[ 3, 4, 5]],
​ [[ 6, 7, 8],
​ [ 9, 10, 11]]])

保存单个数组

np.save(
    "1.npy",
    a1
)

读取单个数组

a2 = np.load("1.npy"
             )
a2

array([[[ 0, 1, 2],
[ 3, 4, 5]],
​ [[ 6, 7, 8],
​ [ 9, 10, 11]]])

创建第二个数组

a3 = np.arange(12,24).reshape(2,2,3)
a3

array([[[12, 13, 14],
[15, 16, 17]],
​ [[18, 19, 20],
​ [21, 22, 23]]])

保存多个数组

np.savez(
    "1.npz",
    a1=a1,
    a3=a3,
)

读取多个数组

a1_a3 =  np.load("1.npz"
             )
a1_a3
a1_a3["a1"]

array([[[ 0, 1, 2],
[ 3, 4, 5]],
​ [[ 6, 7, 8],
​ [ 9, 10, 11]]])

a1_a3["a3"]

array([[[12, 13, 14],
[15, 16, 17]],
​ [[18, 19, 20],
​ [21, 22, 23]]])

Original: https://blog.csdn.net/weixin_44493841/article/details/121376001
Author: 夏华东的博客
Title: numpy 读写 npy npz 文件

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/354163/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

最近整理资源【免费获取】:   👉 程序员最新必读书单  | 👏 互联网各方向面试题下载 | ✌️计算机核心资源汇总