from bs4 import BeautifulSoup
import requests
# url = "https://i.snssdk.com/feoffline/hot_list/template/hot_list/forum_tab.html?activeWidget=1"
url = "http://wsjkw.sc.gov.cn/scwsjkw/gzbd/fyzt.shtml"
res = requests.get(url)
res.encoding = "utf-8"
html = res.text
soup = BeautifulSoup(html, features="lxml")
a = soup.find("a")
print(a)
# 获取字典
print(a.attrs["href"])
url_new = "http://wsjkw.sc.gov.cn"+a.attrs["href"]
res = requests.get(url_new)
res.encoding = "utf-8"
html = res.text
soup = BeautifulSoup(html, features="lxml")
context = soup.find("p")
print(context)