文章詳情頁
python - type函數問題
瀏覽:143日期:2022-06-30 10:34:48
問題描述
import requestsres=requests.get(’http://news.sina.com.cn/china/’)res.encoding='utf-8'#print(res.text)from bs4 import BeautifulSoupsoup=BeautifulSoup(res.text,’html.parser’)aa=soup.select(’a’)for ii in aa: print type(ii)錯誤信息:SyntaxError: invalid syntax
問題解答
回答1:python版本是什么, 2.x 還是3.x, 如果是3.x , 代碼改成:
print(type(ii)).
相關文章:
1. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””2. docker-compose中volumes的問題3. boot2docker無法啟動4. nignx - docker內nginx 80端口被占用5. docker安裝后出現Cannot connect to the Docker daemon.6. dockerfile - 為什么docker容器啟動不了?7. docker容器呢SSH為什么連不通呢?8. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值9. java - SSH框架中寫分頁時service層中不能注入分頁類10. 關于docker下的nginx壓力測試
排行榜

網公網安備