Here i am going to scrape the Options for Google as in figure below:
We must first set up the page as below:
Loading ....
Here the important thing to remember is that , the property of html tags are changed by yahoo so when it does , be sure to change the propery of the html tags in my case change attrs in the given code below . So we are going to use soup lets do some magic.
Loading ....
Use firebug or something to find the html tags and their corresponding properties . As the property keeps on changing so i am going to show how it is done step wise with the results from each step.Firstly take a look at the site of yahoo finance here .
<
Loading ....
Finally we can go off with the values for the same .
Loading ....
In the entire excercise we have obtained all the values needed . For my case i would like to now enter import it in excel and use IronSpread to calculate the cell values . I guess that will be in some other post . I will soon tell you how to use python with excel and bug off all the complicated vba scripts .Also write the macros . it will be pretty interesting stuff, if you want to take a look i suggest take a look at IronSpread.
No comments:
Post a Comment