这里写自定义目录标题
session = requests.session()
url = 'https://www.guazi.com/bj/dazhong/'
content_html = session.get(url).content.decode('utf-8')
js = re.findall('eval\((.*)\)\;var\s*?value',content_html)[0]
js_2 = re.findall('var\s*?value.*',content_html)[0].replace('xredirect','return xredirect')
value = re.findall(r'value\s*?\=\s*?anti\S+\;', content_html)[0]
js_ = """
function aaa() {
return (%s)
}
aaa()
""" % js
js_content = execjs.compile(js_)
real_content = js_content.call('aaa')
real_js_ = real_content.replace('''if(document.cookie.indexOf(name)===-1&&navigator.cookieEnabled){alert('请修改浏览器设置,允许cookie缓存')}else{if(url==''){var url=location.href;if(location.protocol!='https:'){url='https:'+window.location.href.substring(window.location.protocol.length)}}else{if(location.protocol!='https:'){url='https:'+url}}var ulen=url.indexOf('#');if(ulen!==-1){url=url.substring(0,ulen)}location.replace(url)}}''','}').replace('document.cookie','return cookies')
js_2_ = """
function aaa() {
%s
}
""" % js_2 + real_js_
content = execjs.compile(js_2_)
l = content.call('aaa')
session.cookies['antipas'] = l.split('=')[1].split(';')[0]
print(session.get(url=url).text)