scrapy在python爬虫中建立目录的方法

这篇文章主要介绍scrapy在python爬虫中建立目录的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

scrapy代码目录

运行:

scrapy startproject tutorial

即可自动创建官方标准的代码目录。

tutorial/
    scrapy.cfg
    tutorial/
        __init__.py
        items.py
        pipelines.py
        settings.py
        spiders/
            __init__.py
            ...

其中:

tutorial/: 该项目的python总模块。

tutorial/items.py: 项目中的item文件,编写爬取的字段名称等;

tutorial/pipelines.py: 项目中的pipelines文件;

tutorial/settings.py: 项目的设置文件,较为重要;

tutorial/spiders/: 放置spider代码的主目录;

以上是scrapy在python爬虫中建立目录的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注行业资讯频道!