I am trying to automate login process of onlyfans and I am stuck now. I have completely coded the scrapper but the only issue I am getting is the reCaptcha in the login process. First of all, it doesn't appear everytime I try to login. As soon as I click on the login button. Suddenly a reCaptcha appears and instantly login button gets disabled. Please keep it in mind that it appears sometimes. Like sometimes it allows me to login without the Captcha verification and sometimes it asks me to verify.
The problem is that this captcha on onlyfans.com doesn't have a sitekey and I am not able to automate it correctly. Can anybody please guide me what kind of Captcha it actually is and how do we deal with such captchas that are not always on the screen and appears when a certain action is performed that too randomly. The login button isn't clickable until the captcha doesn't get a solved sign on it.
Any expert here who can guide me regarding this? Thank you in advance.
Here is the code I am using to bypass the captcha using 2captcha
P.S: I am not sure about the site key I just got it from somewhere lol. I am not sure now how I got it but its probably not in DOM. Here is my code:
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from twocaptcha import TwoCaptcha
api_key = os.getenv('APIKEY_2CAPTCHA', 'a67-----6')
solver = TwoCaptcha(api_key)
try:
result = solver.recaptcha(
sitekey='6LddGoYgAAAAAHD275rVBjuOYXiofr1u4pFS5lHn',
url='https://onlyfans.com/')
except Exception as e:
print(e)
else:
print('solved: ' + str(result['code']))
return str(result['code'])
One more thing.. Do I need to add this result in the DOM anywhere? If yes, can you please guide me the right method as I have been trying it from past 2 days and literally tried everything to automate this site but failed.
Thanks in advance.