Jan-26-2020, 04:59 PM
I am trying to extract the Httponly, Secure, domain and path from the given cookie in python. How do I do that in python ???
Code:
Code:
target_url = "https://www.google.com/" response2 = requests.get(target_url).headers['Set-Cookie'] print(response2)Result:
Output:1P_JAR=2020-01-26-16; expires=Tue, 25-Feb-2020 16:51:26 GMT; path=/; domain=.google.com; Secure, NID=196=EXN1Mahz2_DymAp2otc-1JaTFvOHMPZHUWg9qPAA87OO4fx21wvl6D1aqY75vAjo1-4OcdAFJo1bqvpAR-IJ4m9c01KjXxF2UoH4A6Nacu3jwiY-DtUgwnNKtMfIS6wbCPhTexYlb43z6ostuA1K_S0eKjIlDqmkqRmMXUHwu3o; expires=Mon, 27-Jul-2020 16:51:26 GMT; path=/; domain=.google.com; HttpOnly