python爬取搜狐網的新聞

搜狐網址:http://www.sohu.com/ 爬取圖片中紅框中的標題名和鏈接   1 import requests 2 from bs4 import BeautifulSoup 3 #搜狐網 4 newsurl = 'http://www.sohu.com/' 5 #用get方法進行網頁獲取 6 res = requests.get(newsurl) 7 #用utf-8的編
相關文章
相關標籤/搜索