2Captcha | Simple API wrapper for https : //2captcha.com | Form library
kandi X-RAY | 2Captcha Summary
kandi X-RAY | 2Captcha Summary
Simple HTTP API wrapper for 2captcha.com An online captcha solving and image recognition service.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of 2Captcha
2Captcha Key Features
2Captcha Examples and Code Snippets
/*
* Class initialization
* Optionally you can pass 2nd parameter `httpClient` with custom HttpClient to use while requesting API
*/
var captcha = new _2Captcha("API_KEY");
var captchaCustomHttp = new _2Captcha("API_KEY", new HttpClient());
/*
*
public struct Result
{
public readonly bool Success;
public readonly JToken ResponseObject;
public string ResponseJson;
public string Response;
public double ResponseDouble;
public Coordinates[] ResponseCoordinates;
}
Community Discussions
Trending Discussions on 2Captcha
QUESTION
I'm trying to signup on twitter using selenium and using 2captcha API to solve the captcha but for some reason when clicking continue the page refreshes and doesn't proceed
...ANSWER
Answered 2021-Sep-20 at 14:34if you write on Python try to do so
QUESTION
I am attempting to use Puppeteer and puppeteer-extra-plugin-recaptcha through Apify to solve the Recaptcha on a login page.
In time, I will want to do the full login. For now, I am attempting to do the Recaptcha solution, using Google's demo. puppeteer-extra-plugin-recaptcha taps up the 2captcha service via API key to do the solving.
Unfortunately, in my code, the important solveRecaptchas()
throws an error:
ANSWER
Answered 2021-Oct-17 at 11:25This might be an omission from the example you provided, but it seems that you're not calling the addPlugins()
function anywhere and therefore the plugin is not used at all.
QUESTION
My app starts with a simple html form. the inputs are PIN# and Date Of Birth.
My express server runs on the same port 3000, when the user submits their data, puppeteer starts and logs into a specific webpage. Then I scrape the image on that webpage. Google Api takes the text from that image and saves it in an array. I then post that array string to src/results.html. But as soon as the user hits submit, they are redirected to /resuts route right immediately and the page says cannot post the data. but when I see in the console (roughly a minute later) that the post was successful, I refresh the page and I get the array of text I wanted to see.
How can I await for the data to finish being posted to the route before the page loads the data? Im using react for client side. below is my server side code. client side is just a basic react page login and a static /results page meant for the data.
...ANSWER
Answered 2021-Aug-31 at 05:43I think I got the problem.
In the react
app, maybe you are not using e.preventDefault()
when you click submit. The browser, by default, redirects to a page where the form action is directing, if the action attribute is empty then the browser reloads the same page. I would recommend you to use e.preventDefault()
on form submission and then use fetch
API to make the request.
In the express
server, on the route POST "results", you are not sending any response back to the user. You should always send a response to the user. In your case you are calling the App
function - which has many async functions, but you are not awaiting for App()
to complete in the POST route, express is sending default response to the user as soon as it parses App()
- it is not waiting for the App()
to complete - express will get to this later.
You can make the (req, res) => { ... }
function in the route as async
function async (req, res) => { ... }
, then you can make the App
as async function as well. Then you can await App(...)
in the route function. Also, you need to await for the main()
function as well inside the App()
function. Then once App()
call has finished, you can send redirect response to the user.
QUESTION
I am trying to solve Hcaptcha with 2captcha in python selenium I tried to launch the driver and add 2captcha extension and set it but it's not working
and I tried a lot of codes but no one of them work (and no one of them is selenium)
...ANSWER
Answered 2021-Aug-21 at 21:47You could try using undetected chromedriver, its basically selenium but with all the flags that selenium left in that expose it as a browser automation tool - hidden. With that, you can simply try clicking on the checkbox (assuming that's the captcha you are getting)
https://github.com/ultrafunkamsterdam/undetected-chromedriver
QUESTION
I'm trying to bypass hcaptcha without submit button.
So I need to know the callback name function but I can't find it in the source code of the page.
Any idea how to submit my request after received my token thx to a captcha resolver ?
Looks like it's possible for recaptcha : https://gist.github.com/2captcha/2ee70fa1130e756e1693a5d4be4d8c70
But can't find the same solution for hcaptcha.
Thx for the help.
...ANSWER
Answered 2021-Jun-11 at 09:47This looks pretty straightforward actually:
QUESTION
Ok first of all I don't want to annoy anyone here I'm fairly new to coding and I'm well aware that asking in these forums should be your last place to go and only after you googled for a while. Anyway I have a problem. I tried to use 2captcha for my python web scraping automation. When I run the script I get the captcha token from 2captcha and in their API documentation they said, that I have to put the Token into the Value of the Element with fc-token inside (Screenshot)
Now I would like to place the token into the value="" of the html code and then submit.
This is what I've tried so far:
...ANSWER
Answered 2021-Jun-05 at 01:17It should look like:
QUESTION
I'm trying to use 2Captcha service to solve an h captcha V2.
Works like this:
- you get a value to solve the captcha
- Then you find a textarea element in the HTML code to insert that value (here's my problem)
- you insert the value in that element
- You press submit button and the captcha is solved
First I'm going to present a working example, then I'll present where I have the problem.
This is the HTML code to find and insert the obtained value:
...ANSWER
Answered 2021-May-22 at 13:48Try this:
QUESTION
I'm trying to upload an image captcha to 2captcha API but I'm receiving the error ERROR_ZERO_CAPTCHA_FILESIZE but my file size on my directory is above 60KB why am I still receiving this error?
Am I missing something?
I've tried sending the only captcha image(originally downloaded from the source) but I received the same error or TOO_MANY_BAD_IMAGES. Please help me.
CODE:
...ANSWER
Answered 2021-Jan-07 at 09:57Regarding your comment, I think your problem is using 2captcha API?
If so, instead of using request module, try their in-house API TwoCaptcha
.
Install it by: pip3 install 2captcha-python
I have a snippet here that you can try to upload your sample:
QUESTION
I am getting data from a previously requested url. Everything works so far.
My problem: I try to make a query every X seconds and if the query shows a different value, something should be done. But it prints Solving-Capture even when finalresponseback != notready
...
ANSWER
Answered 2020-Nov-14 at 09:51This is because of the way you have writen your code, let's say that finalresponseback is not ready, then this would happen:
QUESTION
I am using this library which is the official Python wrapper for the 2captcha API service: https://github.com/2captcha/2captcha-python/tree/master/twocaptcha
The code is really simple to integrate but I've been having a problem with figuring out how to run it asynchronously. I've tried editing their code and replacing the instances of time.sleep
with asyncio.sleep
but the function is still blocking my event loop. Here is the code I am using to solve the captcha:
ANSWER
Answered 2020-Nov-13 at 20:25I solved the issue so here it is for anyone who finds this.
Previously the blocking call would be made like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install 2Captcha
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page