代码: import requests from bs4 import BeautifulSoup r = requests.get("https://python123.io/ws/demo.html") print(r.text) print("\n") demo = r.text print(demo) soup = BeautifulSoup(demo, "html.parser") print("递归:\n") print(soup.head) print("\n") print(soup.head.contents) print("\n") print('body is:\n'+