Question: I'm looking for historical data of the CAC40 components.

I looked at these previously asked questions:

* [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online)
* [Finding historical data for indices](https://quant.stackexchange.com/questions/14687/finding-historical-data-for-indices)

as well as Yahoo Finance and the official CAC40 site (on Euronext).

The issue is that it's easy with Yahoo finance to find:

* the historical data for a CAC40 company
* a list of **current** CAC40 components

but **not** the list of CAC40 components at the time.

Are there any sources from which I could download this information from ?

Edit: If this kind of data is available for the SP500, I would be very interested as well!

Answer: 
As you said yourself, Yahoo finance provides the historical stock data. The only thing left is to know the historical composition of the CAC40. This information can be extracted from the french [wikipedia site about the CAC40](http://fr.wikipedia.org/wiki/CAC_40#Historique_de_la_composition), or from the source @jean-paul-sartre mentioned. In my answer I will concentrate on how to scrap the information. 

Some time ago I wrote a `R`function to scrap information from wikipedia tables. Using the `R-package RCurl` one has to specify the URL of the wikipedia website and a number $n$ which table to scrap. I download the sourcecode by

```
x <- getURL(url="http://fr.wikipedia.org/wiki/CAC_40")

```

and with the help of `gregexpr` I search for `<table` and `</table>`, take the $n$-th table. Then I iterate over `<tr>` cells, get the heading from `<th>` and the actual content from `<td>` cells. Sometimes one has to tidy up a bit. Scraping the two tables from wikipedia, combining them and extracting the historical development of the CAC40 constituents is now straightforward.
Bloomberg or datastream are the only possible sources.