Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
imrebuurman opened this issue Mar 2, 2022 · 1 comment
Open

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

imrebuurman opened this issue Mar 2, 2022 · 1 comment

Comments

@imrebuurman
Copy link

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?

@ireneb612
Copy link

@imrebuurman have you found any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants