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?
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
Convert the time value from string to time value and sort it