linkedin-api icon indicating copy to clipboard operation
linkedin-api copied to clipboard

AttributeError: 'NoneType' object has no attribute 'attrs'

Open hybla0 opened this issue 5 years ago • 5 comments

hello, i used the provided example in the 'examples' folder but i get the below error I logged in manually to linkedin and i completed i captcha challenge but i still got the same result.

Traceback (most recent call last): File "basic.py", line 6, in linkedin = Linkedin(user, pwd) File "/home/lubuntu/.local/lib/python3.6/site-packages/linkedin_api/linkedin.py", line 69, in init self.client.authenticate(username, password) File "/home/lubuntu/.local/lib/python3.6/site-packages/linkedin_api/client.py", line 99, in authenticate self._fetch_metadata() File "/home/lubuntu/.local/lib/python3.6/site-packages/linkedin_api/client.py", line 121, in _fetch_metadata "meta", attrs={"name": "applicationInstance"} AttributeError: 'NoneType' object has no attribute 'attrs'

hybla0 avatar Dec 27 '20 18:12 hybla0

Hi hybla0,

Even I am facing this issue. Any workaround for this?

Traceback (most recent call last): File "Linkdn_API_demo.py", line 60, in CreateConfig() File "Linkdn_API_demo.py", line 32, in CreateConfig api = Linkedin(username, password) File "/home/ubuntu/.local/lib/python3.8/site-packages/linkedin_api/linkedin.py", line 69, in init self.client.authenticate(username, password) File "/home/ubuntu/.local/lib/python3.8/site-packages/linkedin_api/client.py", line 99, in authenticate self._fetch_metadata() File "/home/ubuntu/.local/lib/python3.8/site-packages/linkedin_api/client.py", line 120, in _fetch_metadata clientApplicationInstanceRaw = soup.find( AttributeError: 'NoneType' object has no attribute 'attrs'

pinnamaneni2005 avatar Feb 25 '21 07:02 pinnamaneni2005

I got the same problem today and sorted it! Go to LinkedinApiSettings.COOKIE_PATH on your linux:

/home/ubuntu/.linkedin_api/cookies/

on windows:

C:\Users\<username>\.linkedin_api\cookies

and delete the cookies.jr file and run it again.

marcelogrsp avatar Mar 31 '21 14:03 marcelogrsp

Thanks a lot, Marcelo.

pinnamaneni2005 avatar Mar 31 '21 15:03 pinnamaneni2005

Hi Marcelo,

After clearing the jr file, for each request, it is navigating to the security page. Previously, we didn't have any issues by using this script but now we are unable to extract the data.

ChintalaRaju avatar Apr 15 '21 12:04 ChintalaRaju

I got the same problem today and sorted it! Go to LinkedinApiSettings.COOKIE_PATH on your linux:

/home/ubuntu/.linkedin_api/cookies/

on windows:

C:\Users\<username>\.linkedin_api\cookies

and delete the cookies.jr file and run it again.

Thanks, this worked for me, window Users/{user_name}/.linkedin_api/cookies

PMLS3 avatar Jul 11 '21 06:07 PMLS3