Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2020 Data #4

Open
jroakes opened this issue Dec 21, 2020 · 1 comment
Open

2020 Data #4

jroakes opened this issue Dec 21, 2020 · 1 comment

Comments

@jroakes
Copy link

jroakes commented Dec 21, 2020

Here is 2020 data pulled from: https://fortune.com/fortune500/2020/search/

Data: https://pastebin.com/SPqSYk9n

Pulled all 1k using the code below by clicking through each 100 results and running the code below. Collected today.

// If text is not set initialize and add heading row.
if (typeof(text) == 'undefined' || !text.length){

    var text = ""
    // Add Headings
    var rowText = ""; 
    $$('.searchResults__columnTitle--1Brf4').forEach((e)=>{ rowText += e.textContent.replace(',', ' ') + ","; });
    text += rowText.slice(0, -1) + "\n";
};


// Loop through table adding rows.
$$('.rt-tr-group').forEach((e)=>{ var rowText = ""; 
                                  e.querySelectorAll('span').forEach((i) => {
                                      rowText += i.textContent.replace(',', '') + ","; 
                                      }); 

                                      text += rowText.slice(0, -1) + "\n"; 
                                      }
                           );
@slavakurilyak
Copy link

@cmusam please add 2020 data to the /csv folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants