摘要: import requestsfrom lxml import etreeurl = 'https://www.kuaidaili.com/free/'headers = { 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) 阅读全文
posted @ 2020-01-09 16:13 import* 阅读(1336) 评论(0) 推荐(0) 编辑
摘要: from urllib import parseimport lxmlimport requestsdef parse_url(): key_word = input('请输入关键字>>:') # 微博的url编码两次 key_word = parse.quote(key_word,encoding 阅读全文
posted @ 2020-01-09 16:12 import* 阅读(196) 评论(0) 推荐(0) 编辑
摘要: import requests# 使用proxies关键字response = requests.get('https://www.baidu.com', proxies={ # 'http':'http://114.101.18.169:65309', 'socks5':'http://114.1 阅读全文
posted @ 2020-01-09 16:07 import* 阅读(224) 评论(0) 推荐(0) 编辑
摘要: from urllib import parsekey_word = "中文"url = 'https://s.weibo.com/weibo/' + parse.quote(key_word,encoding='utf8')print(url)#https://s.weibo.com/weibo/ 阅读全文
posted @ 2020-01-09 16:03 import* 阅读(175) 评论(0) 推荐(0) 编辑