import requests
res=requests.get('http://news.sina.com.cn/china/')
res.encoding="utf-8"
#print(res.text)
from bs4 import BeautifulSoup
soup=BeautifulSoup(res.text,'html.parser')
aa=soup.select('a')
for ii in aa:
print type(ii)
错误信息:SyntaxError: invalid syntax
python版本是什么, 2.x 还是3.x, 如果是3.x , 代码改成: