摘要: 用my_fake_useragent生成headers import random from my_fake_useragent import UserAgent def gererateUserAgent(): headers = {} headers_list = ua.get_useragen 阅读全文
posted @ 2019-12-02 12:20 lijifei 阅读(417) 评论(0) 推荐(0)
摘要: 导入库 import os import requests from bs4 import BeautifulSoup import time 生成请求headers def res_headers(): headers = { 'User-Agent': 'Mozilla/5.0 ', 'Refe 阅读全文
posted @ 2019-11-27 18:16 lijifei 阅读(3272) 评论(0) 推荐(0)
摘要: 导入库 json用于读取和写入文件 requests请求html RequestException用于获取requests错误 time定义时间 re正则表达式 import json import requests from requests.exceptions import RequestEx 阅读全文
posted @ 2019-11-27 16:34 lijifei 阅读(247) 评论(0) 推荐(0)
摘要: mac os 环境变量 系统级别 /etc/profile /etc/paths 用户级别 ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc(同linux) 系统级别更为就是全局设置,不推荐 mac系统中推荐更改~/.bash_profile 格式 阅读全文
posted @ 2019-11-22 11:32 lijifei 阅读(369) 评论(0) 推荐(0)
摘要: 升级到10.15.1以后通过alias 可以更换python ,但pip3 一直不能,没有找到解决方法 但在使用pip3安装第三方库时一直报错,提示权限不足 查询各种方案 pip3 install requests 提示未成功 python3 -m pip3 install requests 仍然提 阅读全文
posted @ 2019-11-22 10:31 lijifei 阅读(829) 评论(0) 推荐(0)
摘要: 升级到10.15.1以后python有些问题,尝试修复总是不成功,干脆重做一个系统 结果 command + R 恢复不成功 尝试option +command + R网络恢复也报错 怀疑是之前格式化了整个硬盘导致,重新把所有分区删除扔没有解决 搜索网络解决方案发现需要更换网络供应商 还好本地有移动 阅读全文
posted @ 2019-11-22 10:26 lijifei 阅读(18331) 评论(0) 推荐(0)
摘要: 弄了一个mac pro 玩发现 Mac默认的python版本为2.7 自己安装了3.7的版本 修改 ~/.bash_profile 文件 查看python3安装路径 which python3 /Library/Frameworks/Python.framework/Versions/3.7/bin 阅读全文
posted @ 2018-08-27 14:22 lijifei 阅读(4623) 评论(1) 推荐(1)
摘要: 好多年了,自己总是学会了就会了,没有形成一个有效的积累过程。 现在开始学习Python了,对学习到的知识做好笔记, 顺便对以往知识和技能也做一个整理。 努力吧,少年 --2018年1月15日 发现自己还是没有坚持下来啊 2019年11月22日 阅读全文
posted @ 2018-01-15 18:16 lijifei 阅读(167) 评论(0) 推荐(0)