Yunyuzuiluo

Python爬虫学习 第一天

首先爬虫就是在网上大量信息里抓取你想要的信息的东西
Python写爬虫最方便,所以用Python

from urllib.request import urlopen
resp=urlopen('网址')//打开网址
print(resp.read().decode('utf-8'))//读取并转化成中文
with open('001.html',mode='w',encoding='utf-8) as f:
f.write(resp.read().decode('utf-8')//爬下来写到001.html文件里

posted on 2025-03-23 21:44  刘晋宇  阅读(7)  评论(0)    收藏  举报

导航