Home > other >  Bosses to see where this is wrong
Bosses to see where this is wrong

Time:09-27

The import requests
The import re
From the random import randint
Def CrawlerHouse () : url="https://www.danke.com/room/hz" headers={' the user-agent ':' Mozilla/5.0 (Windows; U; Windows NT 6.1; En - us) AppleWebKit/534.50 (KHTML, like Gecko) Version 5.1/Safari/534.50 '} res=requests. Get (url, headers=headers [randint (0, len (headers) - 1)]) res. The encoding="utf-8" infolist=re. The.findall (' & lt; Div & gt; (. *?)
'res. Text, re S) I=1 for one in infolist: two=one. The split (' & lt; Span & gt; {0} & lt;/span> Two '. The format (I))=' '. Join (two) job=re. The.findall (' & gt; (. *?) ', two, re S) job=' '. Join (job) strip () print (job) I +=1 CrawlerHouse ()

CodePudding user response:

The script code inserted in a class, the objectives clear, more easy to attract the bosses to solve, look at the mess
  • Related