How can I see all notes of a Tumblr post from Python?

后端 未结 4 1178
旧巷少年郎
旧巷少年郎 2020-12-19 03:27

Say I look at the following Tumblr post: http://ronbarak.tumblr.com/post/40692813…
It (currently) has 292 notes.

I\'d like to get all the above n

4条回答
  •  情话喂你
    2020-12-19 04:20

    Without JS you get separate pages that only contain the notes. For the mentioned blog post the first page would be:

    http://ronbarak.tumblr.com/notes/40692813320/4Y70Zzacy

    Following pages are linked at the bottom, e.g.:

    • http://ronbarak.tumblr.com/notes/40692813320/4Y70Zzacy?from_c=1358403506
    • http://ronbarak.tumblr.com/notes/40692813320/4Y70Zzacy?from_c=1358383221
    • http://ronbarak.tumblr.com/notes/40692813320/4Y70Zzacy?from_c=1358377013

    (See my answer on how to find the next URL in a’s onclick attribute.)

    Now you could use various tools to download/parse the data.

    The following wget command should download all notes pages for that post:

    wget --recursive --domains=ronbarak.tumblr.com --include-directories=notes http://ronbarak.tumblr.com/notes/40692813320/4Y70Zzacy
    

提交回复
热议问题