蓝绝

博客园 首页 新随笔 联系 订阅 管理

 

 --正常网页读取

import urllib.request

url='https://www.lingdianshuwu.com/'

#发送请求
resp=urllib.request.urlopen(url)    #这个网页只有get
html=resp.read().decode('gbk')   #decode将bytes类型转成str类型
print(html)

----网页输入账号密码读取

import urllib.request

url='https://www.lingdianshuwu.com/'

#发送请求
resp=urllib.request.urlopen(url)    #这个网页只有get
html=resp.read().decode('gbk')   #decode将bytes类型转成str类型
print(html)

  

posted on 2023-01-11 20:42  蓝绝  阅读(87)  评论(0编辑  收藏  举报