search

Home  >  Q&A  >  body text

php - python scrapy collects Baidu Tieba and stores it in mysql. The storage time of the data is confusing. Is there any way to store it according to the posting time of Baidu Tieba?

Python scrapy collects Baidu Tieba and stores it in mysql. The storage data is chaotic. Is there any way to save it according to the posting time of Baidu Tieba?

Pictured:

< /p>

The following column of times. It is the time when the poster of Baidu Tieba posted the message that I collected. After entering the warehouse, I found that this time is very confusing. There is today's and yesterday's. last month. . . .

If you want to store the chronological order of Baidu Tieba posts into the database.

What ideas are needed to achieve this?

阿神阿神2863 days ago451

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 13:07:03

    Is there no way? Unless you cache all the captured unordered data, sort it and then write it into the database, but the database already has the ability to retrieve data. Why is the poster obsessed with the writing order? order by

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:07:03

    Convert the time value from string to time value and sort it

    reply
    0
  • Cancelreply