Created
June 15, 2022 23:07
-
-
Save Octagon-simon/74b10dfcea391ceb888c0e8a1d20f633 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function solveCaptcha(siteKey, pageUrl){ | |
| //make printing text easier | |
| let log = (text) => {console.log(text)}; | |
| let logErr = (text) => {console.error(text)}; | |
| //your api key | |
| const apiKey = "YOUR_API_KEY"; | |
| //make a GET request to 2captcha | |
| fetch(`https://2captcha.com/in.php?key=${apiKey} | |
| &method=userrecaptcha&googlekey=${siteKey}&pageurl=${pageUrl}&json=1`) | |
| .then(response => response.json()) | |
| .then(data => { | |
| //do something with the data | |
| }) | |
| .catch(error => { | |
| logErr('Error:', error); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment