import requestsfrom bs4 import BeautifulSoupresponse = requests.get("https://www.cnblogs.com/wangyinghao/p/10712328.html");response.encoding="UTF-8"doc = BeautifulSoup(response.text,"html.parser")print(doc.find(id='id2'))