Skip to content

Instantly share code, notes, and snippets.

@vaayne
Created July 30, 2019 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaayne/34b6dd4315830aed3fd232f7e0aca495 to your computer and use it in GitHub Desktop.
Save vaayne/34b6dd4315830aed3fd232f7e0aca495 to your computer and use it in GitHub Desktop.
Xueqiu Headers
def get_cookie_headers():
headers = {
'Referer': 'https://xueqiu.com/',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
}
r = requests.get('https://xueqiu.com/', headers=headers)
if r.status_code == 200:
cookies = r.raw.getheaders().get('Set-Cookie')
headers['Cookies'] = cookies
return headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment