随笔分类 -  涨知识

收藏编程新知识
摘要:在我们爬取网站时,url的关键字中可能含有中文,此时我们需要将中文转换成url编码。 举个例子: import urllib.parse name = urllib.parse.quote('中文') 阅读全文
posted @ 2021-04-27 22:01 一切为了梦想 阅读(2491) 评论(0) 推荐(0)
摘要:1、json# 问题:转字典的字符串中{}里必须是",不能是'。否则会报错import jsona = {'name': 'xl', 'age': 12, 'car': {'type': '汽车', 'price': 10}, 'person': {'job': 'programmer', 'age 阅读全文
posted @ 2021-04-25 10:59 一切为了梦想 阅读(5313) 评论(0) 推荐(0)