16 信息标记形式及信息提取的一般方法

"""信息提取的一般方法"""


import requests
from bs4 import BeautifulSoup

url = "https://python123.io/ws/demo.html"
r = requests.get(url)
demo = r.text
soup = BeautifulSoup(demo, "html.parser")
# http://www.icourse163.org/course/BIT-268001
# http://www.icourse163.org/course/BIT-1001870001
for link in soup.find_all('a'):
    print(link.get('href'))

 

posted @ 2020-06-05 00:50  udbful  阅读(150)  评论(0编辑  收藏  举报