Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function to gather data from three consecutive quarterly result page (15 quarters) #4

Open
guidedlines opened this issue Dec 20, 2018 · 1 comment

Comments

@guidedlines
Copy link

guidedlines commented Dec 20, 2018

When I get to quarterly result, I can only manage to get current 5 quarters. How can I manage to get CSV with current 5 quarter, hit "Previous Years >>" get the 5 quarters from here and then hit it again to get another set of 5 quarter. It can be in one CSV or more than one. Please guide me

Ex
https://www.moneycontrol.com/financials/itc/results/quarterly-results/ITC#ITC

  1. Get thispage
  2. Click "Previous Years >>" get the 5 quarters from here
  3. Again Click "Previous Years >>" get the 5 quarters from here
    in total 15 quarter results

I tried to define another get_data function but doesn't work


def get_QR_Data_parser(aurl,fname):
	soup	= get_soup(aurl)
	og_table	= soup.find('div',{'class':'boxBg1'})
	links	= og_table.find('div',{'class':'FR PB20'})
	for link in links.find_all('b'):
		format_type = link.get_text()
		new_fname = fname + format_type + ".csv"
		if link.find('a',{'class':'active'}):
			table 		= og_table
		else:
			web_address	= baseurl + link.find('a')['href']
			new_soup	= get_soup(web_address)
			table 		= new_soup.find('div',{'class':'boxBg1'})

		get_values(table,new_fname)

Thanks

@guidedlines
Copy link
Author

@vintageplayer any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant