解析网页的写法汇总

 

 

 

  1. urllib 模块

from urllib import request

url = 'https://www.baidu.com/'
rsp = request.urlopen(url)
html = rsp.read()
html = html.decode()
print(html)

  

 

你可能感兴趣的:(解析网页的写法汇总)