上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 96 下一页
摘要: import os#导入发送请求模块:import requests#导入解析文本模块:from bs4 import BeautifulSoup#返回上一级目录:base_path = os.path.dirname(os.path.abspath(__file__))#路径和图片文件夹拼接:im 阅读全文
posted @ 2020-01-17 21:44 干it的小张 阅读(741) 评论(0) 推荐(0) 编辑
摘要: import requests#伪造请求:h = { "user-agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/53 阅读全文
posted @ 2020-01-17 21:06 干it的小张 阅读(202) 评论(0) 推荐(0) 编辑
摘要: import requestsfrom fake_useragent import UserAgenth = { "user-agent": UserAgent().chrome}response = requests.get(url="https://www.zhihu.com/question/ 阅读全文
posted @ 2020-01-17 20:50 干it的小张 阅读(812) 评论(0) 推荐(0) 编辑
摘要: pip install matplotlib -i http://pypi.douban.com/simple/ pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simplepip install -i https://pypi 阅读全文
posted @ 2020-01-17 20:35 干it的小张 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 楔子 在爬虫中进行request请求,很多时候,都需要添加请求头,不然服务器会认为是非法的请求,从而拒绝你的访问。 import requests url = 'https://www.zhihu.com/question/315387406/answer/812734512' response = 阅读全文
posted @ 2020-01-17 20:26 干it的小张 阅读(204) 评论(0) 推荐(0) 编辑
上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 96 下一页