howlongtobeatpy/howlongtobeatpy/HTMLRequests.py
def send_web_request(game_name: str, search_modifiers: SearchModifiers = SearchModifiers.NONE):
        """
        Function that search the game using a normal request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        """
        ua = UserAgent()
        headers = {
            'content-type': 'application/x-www-form-urlencoded',
            'accept': '*/*',
            'User-Agent': ua.random
        }
        payload = {
            'queryString': game_name,
            't': 'games',
            'sorthead': 'popular',
            'sortd': 'Normal Order',
            'plat': '',
            'length_type': 'main',
            'length_min': '',
            'length_max': '',
            'detail': search_modifiers.value
        }
        # Make the post request and return the result if is valid
        r = requests.post(HTMLRequests.SEARCH_URL, data=payload, headers=headers)
        if r is not None and r.status_code == 200:
            return r.text
        else:
            return None

        Function that search the game using a normal request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        
Function that search the game using a normal request
Function that search the game using a normal request
def send_web_request(game_name: str, search_modifiers: SearchModifiers = SearchModifiers.NONE):
        ua = UserAgent()
        headers = {
            'content-type': 'application/x-www-form-urlencoded',
            'accept': '*/*',
            'User-Agent': ua.random
        }
        payload = {
            'queryString': game_name,
            't': 'games',
            'sorthead': 'popular',
            'sortd': 'Normal Order',
            'plat': '',
            'length_type': 'main',
            'length_min': '',
            'length_max': '',
            'detail': search_modifiers.value
        }
        r = requests.post(HTMLRequests.SEARCH_URL, data=payload, headers=headers)
        if r is not None and r.status_code == 200:
            return r.text
        else:
            return None
def send_web_request ( game_name : str , search_modifiers : SearchModifiers = SearchModifiers . NONE ) : ua = UserAgent ( ) headers = { 'content-type' : 'application/x-www-form-urlencoded' , 'accept' : '*/*' , 'User-Agent' : ua . random } payload = { 'queryString' : game_name , 't' : 'games' , 'sorthead' : 'popular' , 'sortd' : 'Normal Order' , 'plat' : '' , 'length_type' : 'main' , 'length_min' : '' , 'length_max' : '' , 'detail' : search_modifiers . value } r = requests . post ( HTMLRequests . SEARCH_URL , data = payload , headers = headers ) if r is not None and r . status_code == 200 : return r . text else : return None
Function that search the game using a normal request
Function that search the game using a normal request
"""
        Function that search the game using a normal request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        """ # Make the post request and return the result if is valid
The HTML code of the research if the request returned 200(OK), None otherwise
The HTML code of the research if the request returned 200 ( OK ) None otherwise
game_name
str
The original game name received as input
The original game name received as input
search_modifiers
SearchModifiers
The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
The " Modifiers " list in " Search Options " allow to show / isolate / hide DLCs