@
qwjhb header={
'Accept':'application/json, text/javascript, */*; q=0.01',
'Accept-Encoding':'gzip, deflate, br',
'Accept-Language':'zh-CN,zh;q=0.9',
'Connection':'keep-alive',
'Content-Length':'909',
'Content-Type':'application/x-www-form-urlencoded',
'Host':'
cn.investing.com',
'Origin':'
https://cn.investing.com',
'Referer':'
https://cn.investing.com/stock-screener/?sp=country::37|sector::a|industry::a|equityType::a|exchange::a%3Ceq_market_cap;1',
'User-Agent':'Opera/8.0 (Macintosh; PPC Mac OS X; U; en)',
'X-Requested-With':'XMLHttpRequest'
}
data={
'country[]':'37',
'sector':'2,11,7,10,1,4,9,5,8,3,6,12',
'industry':'63,85,82,21,10,86,7,78,36,25,4,28,67,5,71,27,61,90,23,68,34,89,43,50,81,41,56,59,69,9,83,29,52,100,58,95,102,94,60,53,38,87,31,6,16,48,55,74,66,35,65,40,99,42,92,98,39,70,32,45,77,20,54,33,24,72,51,30,64,2,96,8,14,22,26,80,15,37,93,13,46,1,79,44,75,91,49,62,88,12,47,84,57,76,17,97,18,19,3,11,101,73',
'equityType':'ORD,DRC,Preferred,Unit,ClosedEnd,REIT,ELKS,OpenEnd,Right,ParticipationShare,CapitalSecurity,PerpetualCapitalSecurity,GuaranteeCertificate,IGC,Warrant,SeniorNote,Debenture,ETF,ADR,ETC,ETN',
'exchange[]':'54',
'exchange[]':'103',
'pn':'1',
'order[col]':'eq_market_cap',
'order[dir]':'d'
}
session = requests.Session()
s =
session.post('
https://cn.investing.com/stock-screener/Service/SearchStocks',params=data,headers=header)
html = etree.HTML(s.text)
我理解应该是这么写的?但还是得不到想要的结果...