Hi everyone,
I need to create a function that return a dictionary with information from a website.
The website I must take the information from is:
https://eresearch.fidelity.com/eresearch...ding.jhtml
My function must return the sector name (sector's name are in the right side of the page), enterprise value, return on equity, and dividend yield (this last 3 information are cointained clicking on each sector).
So I suppose I should create a for loop and also use the i.find('a')['href'] method.
It also says the dictionary might return a structure like this:
{'results':{
'Communication Services': {
'enterprise_value': 286.81,
'return_on_equity': 15.82,
'dividend_yield': 3.91},
'Consumer Discretionary': {
'enterprise_value': 279.53,
'return_on_equity': -293.98,
'dividend_yield': 2.32},
'Consumer Staples': {
'enterprise_value': 164.55,
'return_on_equity': -5.36,
'dividend_yield': 2.75}}}
Hope you can help me thinking how I can make it.
Thank you.
I need to create a function that return a dictionary with information from a website.
The website I must take the information from is:
https://eresearch.fidelity.com/eresearch...ding.jhtml
My function must return the sector name (sector's name are in the right side of the page), enterprise value, return on equity, and dividend yield (this last 3 information are cointained clicking on each sector).
So I suppose I should create a for loop and also use the i.find('a')['href'] method.
It also says the dictionary might return a structure like this:
{'results':{
'Communication Services': {
'enterprise_value': 286.81,
'return_on_equity': 15.82,
'dividend_yield': 3.91},
'Consumer Discretionary': {
'enterprise_value': 279.53,
'return_on_equity': -293.98,
'dividend_yield': 2.32},
'Consumer Staples': {
'enterprise_value': 164.55,
'return_on_equity': -5.36,
'dividend_yield': 2.75}}}
Hope you can help me thinking how I can make it.
Thank you.