Issue
I am trying to scrape data from the tabs: Overview, Technical, Fundamental, Performance, and PivotLabel from this website - https://www.moneycontrol.com/markets/indian-indices/top-nseauto-companies-list/52classic=true&categoryId=2&exType=N but I am able to fetch the table only from the first tab i.e. Overview tab.
I am trying this piece of code to fetch data from Technical tab but it does not work:
y = requests.get(auto_url, data={'id': 'extraIdMT', 'value': 'td52N'})
print(y.content)
Can anyone please help on how to scrape the table from Technical tab.
Solution
You can try to use the developer tool in your browser to see what happens when you click on a tab. When using the network analyzer, you can see that clicking on any tab uses the GET method to call the file ChangeTableData with specific parameters. For the Technical tab it would be this link. You can simply fetch your data from those URLs :)
Here's how the network analyzer looks like:
Answered By - maximall
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.