Wait, if each page has 40,000,000. Then the site would have been set up using a database? Using some varation of SQL, can't you just use SQL to collect the data. For example
SELECT number, name FROM database;
If this is not the case, then it seems like you would need a bot. There are people...