python 爬虫基础

1、robots.txt:  限制互联网爬取引擎的爬取规则。君子协定

2、import request

request.get(url)
with open('girl.png','wb') as fp:

  fp.write()

 

常见协议端口:

 

 

 

 

from urllib import request

url="http://www.baidu.com"

response  = request.urlopen(url)

print(response.read().encode("utf-8"))

posted @ 2023-06-13 01:41  秋日的私语(且行且珍惜)  阅读(4)  评论(0编辑  收藏  举报