python请求表单recaptcha
我一直在尝试使用python编写一个请求表单,但是我被recaptcha阻止了 我需要g-recaptcha-response来填写整个表格,但我不知道如何获得它 我一直在尝试,但我不知道我在做什么。我对验证码一无所知 这是我的密码:python请求表单recaptcha,python,python-requests,recaptcha,invisible-recaptcha,Python,Python Requests,Recaptcha,Invisible Recaptcha,我一直在尝试使用python编写一个请求表单,但是我被recaptcha阻止了 我需要g-recaptcha-response来填写整个表格,但我不知道如何获得它 我一直在尝试,但我不知道我在做什么。我对验证码一无所知 这是我的密码: url = url_add_to_cart c.get(url) c.post(url, data=add_to_cart_FORM, headers={"Refered": link_article}) page = c.get(link_article) if
url = url_add_to_cart
c.get(url)
c.post(url, data=add_to_cart_FORM, headers={"Refered": link_article})
page = c.get(link_article)
if (page.status_code == requests.codes.ok):
print ("ok")
else:
print ("not ok")
url1 = "https://www.supremenewyork.com/checkout.json"
c.get(url)
t = requests.get('http://ip.42.pl/raw')
tt = BeautifulSoup(t.text, 'html.parser')
ip = tt.text
print (ip)
page = c.get(link_checkout)
soup = BeautifulSoup(page.text, 'html.parser')
find_class = soup.find(class_='g-recaptcha')
get_captcha_token = find_class.get('data-sitekey')
try:
content = requests.post(
'https://www.google.com/recaptcha/api/siteverify',
data={
'secret': RECAPTCHA_SECRET,
'response': get_captcha_token,
'remoteip': ip
}
).content
except:
print ("fail")
print (get_captcha_token)
c.post(url, data=payload_FORM, headers={"Refered": link_checkout})
page = c.get(link_checkout)
# page_to_print_for_test = BeautifulSoup(page.text, 'html.parser')
# print (page_to_print_for_test.prettify())
if (page.status_code == requests.codes.ok):
print ("ok")
else:
print ("not ok")
以下是验证码的源代码:
如果你需要更多的信息,我会添加一切!
多谢各位
这是完成我的代码的最后一件事。(我需要正确地编码它^^)你知道吗?我被困在普莱姆的同一部分。由于preme网站上的tohru js和pooky,基于请求的机器人可能会无效,因此selenium是一个更好的选择,但我仍然好奇如何通过requests.nop从不。。。如果需要的话,你可以在推特上给我发DM@lucky_simfr就可以了。退房并离开。不幸的是,我认为这是需要做的。我计划从学习烧瓶开始,今天跟随Ryan学习更多内容。幸运的是,烧瓶据说很容易学