推荐学习书目
› 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
freedom16
V2EX  ›  Python

Python 新人求助 爬虫 b 站 offset 偏移量有什么规律

  •  1
     
  •   freedom16 · May 30, 2022 · 4168 views
    This topic created in 1580 days ago, the information mentioned may be changed or developed.
    我想爬取 bilibili 的主页中的动态页,但是他的偏移量肯定是有规律的,但是才疏学浅没看出规律来
    有没有大佬知道的,求解
    [![rbecGJ.png]( https://i.im.ge/2022/05/30/rbecGJ.png)]( https://im.ge/i/rbecGJ)
    610915518
        1
    610915518  
       May 30, 2022
    图裂了。一个 response data 里面包含是否有下个请求 has_more 和下一个请求的 offset
    learningman
        2
    learningman  
       May 30, 2022
    学一下常见的分页实现就明白了
    Eiden
        3
    Eiden  
       May 30, 2022
    上一次返回的
    Eiden
        4
    Eiden  
       May 30, 2022
    mekingname
        5
    mekingname  
       May 30, 2022
    第二个请求的 offset 来自于第一个请求返回的数据。第三次请求的 offset 来自于第二个请求返回的数据。
    freedom16
        6
    freedom16  
    OP
       May 30, 2022
    @Eiden 谢谢
    freedom16
        7
    freedom16  
    OP
       May 30, 2022
    @learningman 野路子,没接触过哈哈🤞
    freedom16
        8
    freedom16  
    OP
       May 30, 2022
    @mekingname 谢谢
    freedom16
        9
    freedom16  
    OP
       May 30, 2022
    @610915518 谢谢
    filwaline
        10
    filwaline  
       May 31, 2022 via Android
    这种分页叫 cursor pagination
    剩下的你去 Google 一下就都有了
    b 站不知道怎么给命名作 offset 了,可能是为了兼容?
    freedom16
        11
    freedom16  
    OP
       May 31, 2022
    @filwaline 我去看看,谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2335 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:29 · PVG 08:29 · LAX 17:29 · JFK 20:29
    ♥ Do have faith in what you're doing.