Python爬虫抓取腾讯新闻
编译环境:anaconda Jupyter Notebook
抓取所有腾讯新闻,以字典形式存于list。每一条新闻在Q-tpWrap的class中
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = "https://news.qq.com/"
res = requests.get(url)
soup = BeautifulSoup(res.text,'html.parser'