Answer the question
In order to leave comments, you need to log in
How to pass Cookies through Headers?
I use the module of one Internet service.
It has this class
class ScraperAPIClient:
def __init__(self, api_key):
self.api_key = api_key
def get(self,
url,
headers={},
country_code=None,
premium=None,
render=None,
session_number=None,
autoparse=None,
retry=3,
timeout=60):
return makeRequestWithMethod(url, self.api_key, "GET", headers, country_code, premium, render, session_number,
autoparse, retry, timeout, None)
...
client = ScraperAPIClient('34hg32423g5h42j345234gj6776k')
result = client.get(url = 'http://httpbin.org/ip', headers = {"X-MyHeader": "123"})
'aep_usuc_f' : 'isfm=y&site=rus&c_tp=RUB&isb=y®ion=RU&b_locale=ru_RU'
Answer the question
In order to leave comments, you need to log in
Well, in principle, this can be done something like this:
client = ScraperAPIClient('34hg32423g5h42j345234gj6776k')
result = client.get(url = 'http://httpbin.org/ip', headers = {"X-MyHeader": "123", "Cookie": "aep_usuc_f=isfm=y&site=rus&c_tp=RUB&isb=y®ion=RU&b_locale=ru_RU"})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question