Python BeautifulSoup html解析
python BeautifulSoup html解析
import requests
from bs4 import BeautifulSoup
url=input("请输入:")
#http://python123.io/ws/demo.html
r=requests.get(url)
demo=r.text
#将r.text赋给demo
soup=BeautifulSoup(demo,"html.parser")
#用 html.parser解析器解析demo(即 r.text),赋给soup
pri
原创
2020-08-05 09:12:50 ·
212 阅读 ·
0 评论