python 网页编码 乱码

import requests,sys
from bs4 import BeautifulSoup
def gethml(url):
    rr=requests.get(url)
    s=rr.content
    s.decode("ISO-8859-1")
    return s
html=gethml(url)
soup =BeautifulSoup(html, "lxml")
for itema in soup.select(".cname"):
import random,string
passwd="https://jobs.51job.com/all/"
num=string.digits
for i in range(10):
   passwd+=random.choice(num)
passwd+=".html"
print (passwd)

 

上一篇:Linux操作命令_下(远程管理)


下一篇:Linux15--用户管理