Как загрузить сеанс и файлы cookie из браузера Selenium? Следующий код:
import requests
cookies = [{u'domain': u'academics.vit.ac.in',
u'name': u'ASPSESSIONIDAEQDTQRB',
u'value': u'ADGIJGJDDGLFIIOCEZJHJCGC',
u'expiry': None, u'path': u'/',
u'secure': True}]
response = requests.get(url2, cookies=cookies)
дает мне следующее исключение:
Traceback (most recent call last):
File "F:\PYTHON\python_scripts\cookies\cookies3.py", line 23, in <module>
response = requests.get(url2, cookies=cookies)
File "C:\Python27\lib\site-packages\requests\api.py", line 68, in get
return request('get', url, **kwargs)<br/>
File "C:\Python27\lib\site-packages\requests\sessions.py", line 450, in request
prep = self.prepare_request(req)
cookies = cookiejar_from_dict(cookies)
File "C:\Python27\lib\site-packages\requests\cookies.py", line 439, in cookiejar_from_dict
cookiejar.set_cookie(create_cookie(name, cookie_dict[name]))
TypeError: list indices must be integers, not dict