from grab import Grab cookies with open cookie json as js for cookie i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from grab import Grab
cookies = {}
with open('cookie.json') as js:
for cookie in json.loads(js.read()):
cookies[cookie["name"]] = cookie["value"]
g = Grab(cookie=cookies)
g.go('https://market.yandex.ru')
grab.doc.select("//span[@class='user__name']").text()