pull/6/head
injetlee 2016-06-23 23:37:44 +08:00
parent ddea04e411
commit 795a869844
2 changed files with 10 additions and 4 deletions

View File

@ -1 +1,10 @@
# demo
# 这是我日常遇到的一些小问题的解决办法全部是基于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)

View File

@ -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