Crawled the phone with PYTHON+BS4 data:
Importurllib.request fromBs4ImportBeautifulSoupdefspider1 (URL): Headers= {'user-agent':'mozilla/5.0 (Windows NT 6.1) applewebkit/537.11 (khtml, like Gecko) chrome/23.0.1271.64 safari/537.11', 'Accept':'text/html;q=0.9,*/*;q=0.8'} opener=Urllib.request.build_opener () opener.addheaders=[headers] Source_code=opener.open (URL). Read () Soup=beautifulsoup (Source_code,"Html.parser", from_encoding="GBK") forLinkinchSoup.find_all ('DD'): BaseURL=r'http://guisd.com'+link.a['href']+r'all/'Haoduan=Link.a.textPrint(Haoduan) Source_code=Opener.open (BaseURL). Read () Soup=beautifulsoup (Source_code,"Html.parser", from_encoding="GBK") forTabbinchSoup.find_all ('TR') [1:]: forTddinchTabb.find_all ('TD') [0:6]: F.writelines (Tdd.get_text ()+',') F.writelines ('\ n') F=open ('Text.txt','w+') Spider1 ('http://guisd.com/lb/') F.close ()
The final effect is as follows:
Python crawls the phone to its place of ownership