这个问题咋搞啊,求解!!

MarkupResemblesLocatorWarning: " Page not found - MSN https://www.msn.cn/%22 looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.
warnings.warn(

img

首先BeautifulSoup是对网页页面解析,而不是对单个字符串解析,它在解析时会根据html,lxm等解析器对页面标签及元素进行解析以便提取。所以你的代码在运行中报了警告信息。
需要先请求网页获取页面代码再用bs4解析

import requests
from bs4 import BeautifulSoup
url='XXX'
headers={...}
res=requests.get(url,headers=headers)
soup=BeautifulSoup(res.txt,'lxml')
print(str(soup))

如有帮助,请点采纳。

waring 警告信息不影响使用的 你已经成功爬取到了p标签的值,打印处只打印了其类型,可以直接打印其值的。