Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16595

web scrapping of webpage - chartink [closed]

$
0
0

Please help me to scrape this link. link - https://chartink.com/screener/futures-ema-44-89-and-133 I am trying to web scrape but it is not showing the table which I want. please help me the same.

I have tried this code, but it is not giving me the desired result.

import requestsfrom bs4 import BeautifulSoup as bsimport pandas as pddata = {"scan_clause" : "(+{33489}+(+[0]+4+hour+close+>+[-1]+4+hour+ema(+[0]+4+hour+close+,+44+)+and+[+-1+]+4+hour+close+<=+[+-2+]+4+hour+ema(+[0]+4+hour+close+,+44+)+or+[0]+4+hour+close+>+[-1]+4+hour+ema(+[0]+4+hour+close+,+89+)+and+[+-1+]+4+hour+close+<=+[+-2+]+4+hour+ema(+[0]+4+hour+close+,+89+)+or+[0]+4+hour+close+>+[-1]+4+hour+ema(+[0]+4+hour+close+,+133+)+and+[+-1+]+4+hour+close+<=+[+-2+]+4+hour+ema(+[0]+4+hour+close+,+133+)+)+)+"}with requests.Session() as s:    r = s.get('https://chartink.com/screener/futures-ema-44-89-and-133')    soup = bs(r.content, 'lxml')    s.headers['X-CSRF-TOKEN'] = soup.select_one('[name=csrf-token]')['content']    r = s.post('https://chartink.com/screener/process', data=data).json()    #print(r.json())    df = pd.DataFrame(r['data'])    print(df)if len(df)>0:    df = df.sort_values(by='volume', ascending=False)    df.head(50)

Viewing all articles
Browse latest Browse all 16595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>