tomquirk / linkedin-api

👨‍💼 LinkedIn API for Python
https://pypi.org/project/linkedin-api
MIT License
2.15k stars 455 forks source link

Can't connect #435

Open ShubhamMishra2202 opened 1 month ago

ShubhamMishra2202 commented 1 month ago

File s:\linkedin_scrapper\6\venv\lib\site-packages\linkedin_api\client.py:163, in Client._do_authentication_request(self, username, password) 160 data = res.json() 162 if data and data["login_result"] != "PASS": --> 163 raise ChallengeException(data["login_result"]) 165 if res.status_code == 401: 166 raise UnauthorizedException()

ChallengeException: CHALLENGE

ShubhamMishra2202 commented 1 month ago

Seems it can't bypass the CAPTCHAS

Nijneleven commented 1 month ago

You would either create that yourself or you need to use rotating proxies. Brightdata is a good one, I rarely hit any captcha.

wladimiravila commented 1 month ago

hello @Nijneleven , I recently create an account in brightdata and now I got this error

raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/authenticate (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

here my proxies

proxies = { 'http': 'http://heremyusername1:mypass@brd.superproxy.io:22225', 'https': 'https://heremyusername1:mypass@brd.superproxy.io:22225' }

raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/authenticate (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

the curious point is that I use "requests" directly setting the proxies and works!

Nijneleven commented 1 month ago

Try this:

proxies = { 'https': 'http://heremyusername1:mypass@brd.superproxy.io:22225/' 'http': 'http://heremyusername1:mypass@brd.superproxy.io:22225/', }

I always use http for the https setup. Most proxies only allow http