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 ()