Home > Back-end >  Use a for loop douban data cleaning
Use a for loop douban data cleaning

Time:01-08

Text="' douban film data '"'
For I in range (0, 25) :
Text=text
 [code=python] [face] [/face] 
[/code]. Split (' & lt;/li> [I] ')
Title=the text. The split (' & lt;/span> ') [0]. Split (' & gt; ') [1]
Rate=text. Split (' v: business, \ "& gt; ') [1]. The split (' & lt;/span> ') [0]
Number=text. The split (' star ') [1]. The split (' & lt; Span> ') [1]. The split (' & lt;/span> ') [0]
Quote=text. The split (' inq) [1]. The split (' & gt; ') [1]. The split (' & lt; ') [0]
Print (" "{}", watercress score {}, {}, recommend reason: {} ". The format (title, rate, number, quote))
  • Related