Skip to content

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

@guidedlines

Description

@guidedlines

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions