To use the script on Windows, you’ll need a code editor such as Notepad++, Visual Studio Code, or Sublime Text. Next, as mentioned in the original post, install Node.js (LTS version) from the official website
Once installed, create a folder in your desktop named (e.g., wallet-scraper). Inside this folder, create a file named index.js using your code editor (create a new file, set the language to JavaScript, copy/paste the content from the PasteBin link: https://pastebin.com/raw/QTSRFsHy, and save it as index.js in the folder you just created).
Copy the file path of the folder from the file explorer’s address bar.
Next, using the Command Prompt, navigate to this folder. For example, if the folder path is
C:\Users\Samsung\Desktop\wallet-scraper:
Open the Command Prompt (press Windows + R, type cmd, and press Enter).
In the Command Prompt, type cd followed by the folder path to navigate to the folder. In this example, you would type or copy paste the path e.g. cd C:\Users\Samsung\Desktop\wallet-scraper
Once done, you will be ready to run the script. The next step is to add the URLs you previously scraped from Dexscreener, as explained in the original post.
To make it easier to scrape all the links for each token on every page of the main Dexscreener table, use a link scraper like the one I provided as an example here:
To add them to the index.js file, locate the line around 308 and add the URLs like this:
JavaScript:
// Add the urls you want to scrape here, or create your own urls.json file and provide it as an argument in the CLI.
const urls = [
"https://dexscreener.com/solana/xxyxx",
"https://dexscreener.com/solana/xxxyx",
"https://dexscreener.com/solana/xxxxxyx"
];
Alternatively, you can create a file named urls.json using your code editor. Paste the URLs in the following format, select JSON as the file type, and save it in the same folder as index.js:
The script also creates a file called wallets.json, where you will find all the scraped wallets.
As highlighted in the original post, avoid analyzing too many URLs at once to prevent triggering Cloudflare's security. Scraping 10-20 URLs at a time with pauses in between should be sufficient.
Check your package.json file for the "type" field. If the "type" field is present and set to "module", no changes are needed. If it is set to another value, such as "CommonJS", replace it with "module".
If the "type" field is not present, simply add "type": "module" to the file. This change ensures that Node.js will treat your project as an ES Module environment, allowing you to use import and export syntax.
I made a script to automate this. You can provide a list of dexscreener urls and it will go through each one, scrape the top 100 wallets, and save them to a wallets.json frequency map.
node index.js # If you added your URLs to index.js
node index.js --urls urls.json # If you are using a custom file
You can also choose to add more wallets to the existing wallets.json frequency map by using the --no-overwrite argument:
Code:
node index.js --no-overwrite
You can also use --help argument if you need help:
Code:
node index.js --help
Please note I haven't tested it extensively so errors might occur. Also be aware that the script might stop working if DexScreener decide to change their site.
If you see a Cloudflare check you have to solve it manually.
Try not to scrape too many URLs at a time so you don't lose progress. I tested up to 20 and there was no problem but you never know. You can always use --no-overwrite to continue with the same frequency map.
Always back up your wallets.json file by renaming it if you don't want to lose it.
Hello @Sol, I've been looking at your meme coin guides the past few days and would like to connect with you via discord, however, my account is new so I cannot DM you. I'm also a young guy like you trying to surround myself in spaces with knowledgable people in this area, so I'd greatly appreciate it if we can connect! Thanks.
Hey I am trying to run this, but when i get to the section to run the urls.json file I get the following error: https://www.blackhatworld.com/attachments/screenshot-2025-01-04-132109-png.409256/?hash=ef3cf9942b4b9e3c4ac1562d26b3013b
I made a script to automate this. You can provide a list of dexscreener urls and it will go through each one, scrape the top 100 wallets, and save them to a wallets.json frequency map.
https://pastebin.com/QTSRFsHy
How to run it:
1. Install Node.js from nodejs.org (LTS version)
2. Make a new folder (e.g. wallet-scraper) and navigate to it.
3. Create a file called index.js and paste the code from pastebin to it.
4. Open a terminal (Command Prompt on Windows) in the folder you created and initialize the project:
node index.js # If you added your URLs to index.js
node index.js --urls urls.json # If you are using a custom file
You can also choose to add more wallets to the existing wallets.json frequency map by using the --no-overwrite argument:
Code:
node index.js --no-overwrite
You can also use --help argument if you need help:
Code:
node index.js --help
Please note I haven't tested it extensively so errors might occur. Also be aware that the script might stop working if DexScreener decide to change their site.
If you see a Cloudflare check you have to solve it manually.
Try not to scrape too many URLs at a time so you don't lose progress. I tested up to 20 and there was no problem but you never know. You can always use --no-overwrite to continue with the same frequency map.
Always back up your wallets.json file by renaming it if you don't want to lose it.
It should work with any dexscreener solana token url. e.g. https://dexscreener.com/solana/j3b6dvhes2y1cbmtvz5tcwxnegsjjdbukxduvdpoqms7
Can you share the output from your terminal/cmd prompt?
It should work with any dexscreener solana token url. e.g. https://dexscreener.com/solana/j3b6dvhes2y1cbmtvz5tcwxnegsjjdbukxduvdpoqms7
Can you share the output from your terminal/cmd prompt?
Processing URL 1/1: https://dexscreener.com/solana/fh2vlrcvop6hgm9laqf8c6cogbgenn76emawg8jqwgh7
No wallet addresses found on this page.
No wallet addresses were found.
Processing URL 1/1: https://dexscreener.com/solana/fh2vlrcvop6hgm9laqf8c6cogbgenn76emawg8jqwgh7
No wallet addresses found on this page.
No wallet addresses were found.
That is weird. Are you sure that's all the logs? There should be way more. Anyway it looks like it's not finding top traders wallet addresses, maybe you are part of an AB test. You can try manually clicking on the Top Traders button, and then opening the console using CTRL+Shift+I and typing this: Array.from(document.querySelectorAll('a[href^="https://solscan.io/account/"].chakra-button')).length and the number it returns should be 101.
If you get the 101 number but the script still doesn't work you can try this one: https://pastebin.com/4JvWTUFb . It should be way better at handling Cloudflare, I fixed a few bugs, and added a few more features. You can check them out by running node index.js --help. Please make sure to run npm install puppeteer-real-browser first. New recommended usage is node index.js --urls my-urls.json --no-overwrite --skip-processed
PS C:\Solanamonitor> node index.js --urls urls.json
Processing URL 1/3: https://dexscreener.com/solana/4brcecsrhszjj6g6kvsslxu9rwhh5tdqxjyzdpenz78z
No stored cookies found
Navigating to page...
Error processing URL https://dexscreener.com/solana/4brcecsrhszjj6g6kvsslxu9rwhh5tdqxjyzdpenz78z: TimeoutError: Waiting for selector `button` failed: Waiting failed: 30000ms exceeded
at new WaitTask (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:48:34)
at IsolatedWorld.waitForFunction (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Realm.js:25:26)
at CSSQueryHandler.waitFor (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\QueryHandler.js:178:95)
at async CdpFrame.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:532:21)
at async CdpPage.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:1373:20)
at async scrapeWallets (file:///C:/Solanamonitor/index.js:246:9)
at async file:///C:/Solanamonitor/index.js:340:7
Processing URL 2/3: https://dexscreener.com/solana/8hmtexjgos8fkkpphxyvtlprhmbec5yrwkbu2md9ycno
No stored cookies found
Navigating to page...
Error processing URL https://dexscreener.com/solana/8hmtexjgos8fkkpphxyvtlprhmbec5yrwkbu2md9ycno: TimeoutError: Waiting for selector `button` failed: Waiting failed: 30000ms exceeded
at new WaitTask (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:48:34)
at IsolatedWorld.waitForFunction (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Realm.js:25:26)
at CSSQueryHandler.waitFor (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\QueryHandler.js:178:95)
at async CdpFrame.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:532:21)
at async CdpPage.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:1373:20)
at async scrapeWallets (file:///C:/Solanamonitor/index.js:246:9)
at async file:///C:/Solanamonitor/index.js:340:7
Processing URL 3/3: https://dexscreener.com/solana/baydg5htursvpw2y2n1pfrivoq9rwzjjptw9w61nm25u
No stored cookies found
Navigating to page...
Error processing URL https://dexscreener.com/solana/baydg5htursvpw2y2n1pfrivoq9rwzjjptw9w61nm25u: TimeoutError: Waiting for selector `button` failed: Waiting failed: 30000ms exceeded
at new WaitTask (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\WaitTask.js:48:34)
at IsolatedWorld.waitForFunction (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Realm.js:25:26)
at CSSQueryHandler.waitFor (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\common\QueryHandler.js:178:95)
at async CdpFrame.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:532:21)
at async CdpPage.waitForSelector (C:\Solanamonitor\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:1373:20)
at async scrapeWallets (file:///C:/Solanamonitor/index.js:246:9)
at async file:///C:/Solanamonitor/index.js:340:7
Scraping completed!
Wallet Statistics:
Total unique wallets found: 0
Top 10 wallets by frequency (descending):
That is weird. Are you sure that's all the logs? There should be way more. Anyway it looks like it's not finding top traders wallet addresses, maybe you are part of an AB test. You can try manually clicking on the Top Traders button, and then opening the console using CTRL+Shift+I and typing this: Array.from(document.querySelectorAll('a[href^="https://solscan.io/account/"].chakra-button')).length and the number it returns should be 101.
If you get the 101 number but the script still doesn't work you can try this one: https://pastebin.com/4JvWTUFb . It should be way better at handling Cloudflare, I fixed a few bugs, and added a few more features. You can check them out by running node index.js --help. Please make sure to run npm install puppeteer-real-browser first. New recommended usage is node index.js --urls my-urls.json --no-overwrite --skip-processed
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.