V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Phishion
V2EX  ›  Python

请问有没有什么规范的中小型 Python 爬虫项目可供参考?

  •  1
     
  •   Phishion · Mar 30, 2021 · 3237 views
    This topic created in 1863 days ago, the information mentioned may be changed or developed.

    之前一个爬虫 1000 多行全写在一个文件里,这个东西已经毫无维护性了,所以,我想重构一下

    爬的是 API,但是有蛮多定制功能的

    重构的话,我想这个项目应该包含单元测试,有完整的日志记录,解析模块,下载模块,调度器什么的都分开

    我看了几个例子,有面向对象做的,也有全部都是函数的,我问问大伙儿有没有比较规范的样本,但是也不要是什么庞然大物,毕竟本身也不是什么大的项目,我也学习学习,谢谢大家了!

    11 replies    2021-04-05 19:30:41 +08:00
    b29107b
        1
    b29107b  
       Mar 30, 2021 via Android
    github
    learningman
        2
    learningman  
       Mar 30, 2021 via Android
    scrpy 的文档
    learningman
        3
    learningman  
       Mar 30, 2021 via Android
    调 API 不叫爬虫吧,你可以用 metaclass 弄个 wrapper 出来
    triangle111
        4
    triangle111  
       Mar 30, 2021
    mark,做完后看看有没有得白嫖的
    CoCoMcRee
        5
    CoCoMcRee  
       Mar 30, 2021
    找个 scrpy 教程看下, 基本就是当下主流爬虫的做法了.
    hunk
        6
    hunk  
       Mar 30, 2021
    还是自己写吧,现成的框架或多或少都有限制,走了一圈发现,还是自己写。
    另外,前一段,单独把抓取这块改成 go 了,用协程爽歪歪。
    ClericPy
        7
    ClericPy  
       Mar 30, 2021
    这么多人说 scrpy, 看来真不是 scrcpy 和 Scrapy...
    hanssx
        8
    hanssx  
       Mar 31, 2021
    @ClericPy 整得我以为真有 scrpy,还去搜了下。。
    ClericPy
        9
    ClericPy  
       Mar 31, 2021
    @hanssx a ... 我当时搜 Github scrpy 还真搜到个以为就是它, 好吧我错了. 这单词用拼音打出来正好是四川人朋友...
    HankLu
        10
    HankLu  
       Apr 1, 2021
    爬虫写得好,牢饭吃到饱
    ErwinCheung
        11
    ErwinCheung  
       Apr 5, 2021
    爬虫写得好,牢饭吃到饱
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5722 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 183ms · UTC 07:32 · PVG 15:32 · LAX 00:32 · JFK 03:32
    ♥ Do have faith in what you're doing.