Skip to content

Is it possible to add a location to searching for people? #3

Open
@imrebuurman

Description

@imrebuurman

Right now i'm only getting the 422 error when trying to add a location to searching for people. This also happens whenever I try to add anything else.

params = { 'keyword': profession, 'search_type': 'people', }

this is what I am using when it works but the moment I add anything else:

params = { 'keyword': profession, 'search_type': 'people', 'location' : location }

When I use this I get this as an error

`---------------------------------------------------------------------------
Exception Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\iscraper\client.py:52, in Client._send_request(self, path, method, data)
51 else:
---> 52 raise Exception(
53 f'Request failed with status code {res.status_code}')
54 except Exception as e:

Exception: Request failed with status code 422

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Input In [85], in
15 i = '_J'
17 profileList_file = open(r"jsonFiles\universalId" + i + ".json", "x")
---> 18 linkedin_search_list = client.search_results(**params)
19 print(linkedin_search_list)
20 profileList_file.write(json.dumps(linkedin_search_list))

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\iscraper\client.py:126, in Client.search_results(self, keyword, search_type, location, size, per_page, offset)
117 path = '/linkedin-search'
118 data = {
119 'keyword': keyword,
120 'search_type': search_type,
(...)
124 'offset': offset
125 }
--> 126 return self._send_request(path=path, data=data)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\iscraper\client.py:55, in Client._send_request(self, path, method, data)
52 raise Exception(
53 f'Request failed with status code {res.status_code}')
54 except Exception as e:
---> 55 raise Exception(f'Request failed: {str(e)}')

Exception: Request failed: Request failed with status code 422`

Is there any other way to achieve this by using a location?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions