import requests
from bs4 import BeautifulSoup
import re
c=[]
for i in range(1,6):
url="http://weixin.sogou.com/pcindex/pc/pc_0/1.html"
html=requests.get(url)
html.encoding="gzip"
html=BeautifulSoup(html.text,"lxml")
href=html.select(".img-box a")
for h in href:
h=h.attrs["href"]
c.append(h[0:4]+"s"+h[4:])
newhtml=requests.get(h)
newhtml=BeautifulSoup(newhtml.text,"lxml")
title=newhtml.select("title")[0].string
print(title)
很简单的一个爬虫 有时间扩展一下