I
I
Igor Malyga2017-08-01 18:59:19
Python
Igor Malyga, 2017-08-01 18:59:19

How to bypass the check for a robot when authorizing on the site?

Hello. I'm trying to write a bot for authorization on the BC PariMatch website, but when I try to make a request, the site apparently recognizes the bot and makes it check for a robot. Is there a way to avoid this? Here is the program code:

# coding: utf-8

import requests
from bs4 import BeautifulSoup

class Interpals():
 url = "https://www.parimatch.com/"

 def auth(self):
    session = requests.Session()
    url = self.url+"?login=1"
    params = {
    "qt":"dadcb97af8536a33631d3ce718h348",
    "username":"username",
    "passwd":"passwd"
    }
    r = session.post(url,params)
    print(r.text)


if __name__ == "__main__":
interpals = Interpals()
interpals.auth()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
protven, 2017-08-01
@protven

In order not to be banned, you must pretend to be a living person. You would start by getting familiar with the debugging tools in the browser. Open the developer console and see what requests and headers are leaving you towards the server and what responses are coming. The bot should work in the same way.
As for this specific question, you probably need to pass the correct, "human" User-Agent first.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question