码迷,mamicode.com
首页 > Web开发 > 详细

爬取网页数据

时间:2020-04-29 18:02:09      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:pen   bsp   urlopen   with open   nbsp   class   url   stat   urllib   

import urllib.request
# r=urllib.request.urlopen("http://183.247.167.54:7009/#/map")
# print(r.read())#爬取网页源码

r=urllib.request.urlopen("http://183.247.167.54:7009/static/img/logo.ac2237a.png")
rs=r.read()
with open("1.png","wb") as a:
    a.write(rs)#爬取图片

 

爬取网页数据

标签:pen   bsp   urlopen   with open   nbsp   class   url   stat   urllib   

原文地址:https://www.cnblogs.com/tzxy/p/12803324.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!