P
P
pinkFlash2021-07-01 19:25:19
Python
pinkFlash, 2021-07-01 19:25:19

How to submit such a form via python requests?

<form method="post" action="http://api.captcha.guru/in.php" enctype="multipart/form-data">
<input type="hidden" name="method" value="post">
Ваш ключ:
<input type="text" name="key" value="YOUR_APIKEY">
Файл капчи:
<input type="file" name="file">
<input type="submit" value="Загрузить и получить ID">
</form>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2021-07-01
@pinkFlash

import requests

files = {
         'method': (None, 'post'),
         'key': (None, 'apikey'),
         'file': ('file.png', open('file.png', 'rb')),
        }

requests.post('http://api.captcha.guru/in.php', files=files)

S
Sergo Zar, 2021-07-01
@Sergomen

Like so:

import requests
r = requests.get("http://api.captcha.guru/in.php", data={"method":"post","key":"you api key", "file":("file name", open("file name", "rb")})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question