diff --git a/README.md b/README.md index 97be136..3781373 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ -# demo \ No newline at end of file +# 这是我日常遇到的一些小问题的解决办法,全部是基于Python3 +1.[爬取拉勾网招聘信息](https://github.com/injetlee/demo/blob/master/CpuToInfluxdb.py) +2.[模拟登录知乎](https://github.com/injetlee/demo/blob/master/login_zhihu.py) +3.[对目录下所有文件计数](https://github.com/injetlee/demo/blob/master/countFile.py) +4.[获取当前CPU状态,存储到Influxdb](https://github.com/injetlee/demo/blob/master/CpuToInfluxdb.py) +5.[爬取豆瓣电影top250](https://github.com/injetlee/demo/blob/master/douban_movie.py) +6.[Excel文件读入数据库](https://github.com/injetlee/demo/blob/master/excelToDatabase.py) +7.[爬取拉勾网职位信息](https://github.com/injetlee/demo/blob/master/lagouSpider.py) +8.[批量修改文件名](https://github.com/injetlee/demo/blob/master/ModifyFilename.py) +9.[读写excel](https://github.com/injetlee/demo/blob/master/readExcel.py) \ No newline at end of file diff --git a/login_zhihu.py b/login_zhihu.py index 589bdb8..2bf8933 100644 --- a/login_zhihu.py +++ b/login_zhihu.py @@ -8,8 +8,6 @@ def get_captcha(data): def login(username,password,oncaptcha): sessiona = requests.Session() - print(sessiona) - print('aaaa') headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'} xyz = sessiona.get('https://www.zhihu.com/#signin',headers=headers).content _xsrf = BeautifulSoup(sessiona.get('https://www.zhihu.com/#signin',headers=headers).content,'html.parser').find('input',attrs={'name':'_xsrf'}).get('value') @@ -21,7 +19,6 @@ def login(username,password,oncaptcha): "remember_me":True, "captcha":oncaptcha(captcha_content) } - print(data) resp = sessiona.post('https://www.zhihu.com/login/email',data,headers=headers).content print(resp) return resp