INTERESTING Linkedin-Api-Datakund-Readthedocs-Io-En-Latest
INTERESTING Linkedin-Api-Datakund-Readthedocs-Io-En-Latest
Release 0.0.2
datakund
1 Introduction 1
2 Installation/Usage: 3
3 Import bot-studio 5
4 Creating Object 7
4.1 Browser Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Functions 9
5.1 Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 Get Job Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.4 Search People . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5 Search Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.6 Search Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.7 Enter Job Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.8 Send Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.9 Follow Company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.10 Unfollow Company . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.11 Send Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.12 Get Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.13 Get Company Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.14 Click Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.15 People Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.16 Jobs Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.17 Posts Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.18 Open Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.19 Comment On Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.20 Get Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.21 Send Message By Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.22 Upload Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.23 Search Companies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.24 Get Feed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.25 Companies Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.26 Search Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.27 Groups Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.28 Join Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.29 Get Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.30 Get Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
i
5.31 Click Load More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.32 Posts Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.33 Login Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.34 Accept Invitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.35 Clicknext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6 Other Functions 23
6.1 Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2 Get Page Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.3 Get Page Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.4 Get Current Url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.5 Reload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.6 Keypress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.7 Scroll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.8 End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.9 Quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Index 27
ii
CHAPTER
ONE
INTRODUCTION
bot-studio is an automation library which can be used to automate tasks like sending mails,scraping data,auto check-
out and many more. You can download the source code from here(see here)
It uses selenium to automate the things. You can use its inbuilt functions like linkedin_follow, linkedin_login
etc. in a very easy way.
1
linkedin-api-datakund, Release 0.0.2
2 Chapter 1. Introduction
CHAPTER
TWO
INSTALLATION/USAGE:
3
linkedin-api-datakund, Release 0.0.2
4 Chapter 2. Installation/Usage:
CHAPTER
THREE
IMPORT BOT-STUDIO
5
linkedin-api-datakund, Release 0.0.2
FOUR
CREATING OBJECT
linkedin=bot_studio.linkedin()
or
linkedin=bot_studio.linkedin(headless=True,....)
It will return the object which you can further use to call linkedin functions and opens a automated browser
7
linkedin-api-datakund, Release 0.0.2
FIVE
FUNCTIONS
5.1 Login
Parameters
• username (str) – Linkedin username
• password (str) – Linkedin password
Returns {“body”: {}, “success_score”: “100”, “errors”: []}
Return type dict
5.2 Search
9
linkedin-api-datakund, Release 0.0.2
It opens the job link passed in job_link and fetches info about job.
body: returns data
success_score: api success rate
errors: errors encountered in api
Here is the code:-
linkedin.get_job_profile(job_link='https://www.linkedin.com/jobs/search?keywords=python&origin=BLENDED_SEARCH_RE
10 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
Parameters
• message (str) – message which need to be send
• profile_link (str) – profile link of user whom message need to be sent
Returns {“body”: {}, “success_score”: “100”, “errors”: []}
Parameters profile_link (str) – Profile link of user to whom connection need to be sent
Returns {“body”: {}, “success_score”: “100”, “errors”: []}
12 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
Parameters profile_link (str) – Profile link of user whose data need to be fetched
Returns {“body”: {‘Location’: ‘Location’, ‘Info’: ‘Info’, ‘Education’: ‘Education’, ‘About’:
‘About’, ‘Experience’: ‘Experience’, ‘Education_Info’: ‘Education_Info’, ‘Recommendations’:
‘Recommendations’, ‘Mutual_Connections’: ‘Mutual_Connections’, ‘Name’: ‘Name’, ‘Inter-
ests’: ‘Interests’, ‘Current Company’: ‘Current Company’}, “success_score”: “100”, “errors”:
[]}
Return type dict
Returns {}
Return type dict
14 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
Returns {“body”: [{‘User Link’: ‘User Link’, ‘Post Text’: ‘Post Text’}], “success_score”: “100”,
“errors”: []}
Return type dict
Parameters
• post_link (str) – post link where need to comment
• comment (str) – Text need to comment on post
It searches the keyword passed in keyword and clicks on first search result and send message passed in message.
body: returns data
success_score: api success rate
errors: errors encountered in api
Here is the code:-
linkedin.send_message_by_name(message='Hi', keyword='DataKund')
Parameters
• message (str) – Text need to comment on post
• keyword (str) – Name of the user who need to be searched
Returns {“body”: {}, “success_score”: “100”, “errors”: []}
Return type dict
16 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
Returns {“body”: [{‘Post Content’: ‘Post Content’, ‘UserLink’: ‘UserLink’, ‘User Name’: ‘User
Name’}], “success_score”: “100”, “errors”: []}
Return type dict
linkedin.companies_results()
Returns {“body”: [{‘Group Link’: ‘Group Link’, ‘Title’: ‘Title’, ‘Members’: ‘Members’}], “suc-
cess_score”: “100”, “errors”: []}
Return type dict
18 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
linkedin.join_group(group_link='https://www.linkedin.com/groups/2066905?lipi=urn%3Ali%3Apage%3Ad_flagship3_search_srp
Returns {“body”: [{‘User Link’: ‘User Link’, ‘Comment’: ‘Comment’, ‘UserName’: ‘UserName’,
‘Info’: ‘Info’}], “success_score”: “100”, “errors”: []}
Return type dict
20 Chapter 5. Functions
linkedin-api-datakund, Release 0.0.2
5.35 Clicknext
22 Chapter 5. Functions
CHAPTER
SIX
OTHER FUNCTIONS
You can use basic functions which selenium provides with this library like opening a url, get pagesource, get current
url etc. These are the functions:-
6.1 Open
Returns {“pagetitle”:”Linkedin”}
Return type dict
Returns {“pagesource”:”pagesource”}
Return type dict
23
linkedin-api-datakund, Release 0.0.2
Returns {“url”:”url”}
Return type dict
6.5 Reload
Returns {}
Return type dict
6.6 Keypress
6.7 Scroll
Returns {}
Return type dict
6.8 End
Note: You will need to create linkedin object again after end().
linkedin.end()
Returns {}
Return type dict
6.9 Quit
Note: You will need to import bot-studio library again to start application.
linkedin.quit()
Returns {}
Return type dict
6.9. Quit 25
linkedin-api-datakund, Release 0.0.2
B linkedin.send_message(), 11
built-in function linkedin.send_message_by_name(), 16
linkedin.accept_invitation(), 21 linkedin.unfollow_company(), 12
linkedin.click_load_more(), 20 linkedin.upload_content(), 16
linkedin.click_next(), 14
linkedin.clicknext(), 21 L
linkedin.comment_on_post(), 15 linkedin.accept_invitation()
linkedin.companies_results(), 17 built-in function, 21
linkedin.end(), 24 linkedin.click_load_more()
linkedin.enter_job_location(), 11 built-in function, 20
linkedin.follow_company(), 12 linkedin.click_next()
linkedin.get_comments(), 19 built-in function, 14
linkedin.get_company_profile(), 13 linkedin.clicknext()
linkedin.get_current_url(), 24 built-in function, 21
linkedin.get_feed(), 17 linkedin.comment_on_post()
linkedin.get_job_profile(), 10 built-in function, 15
linkedin.get_messages(), 16 linkedin.companies_results()
linkedin.get_page_source(), 23 built-in function, 17
linkedin.get_page_title(), 23 linkedin.end()
linkedin.get_post(), 19 built-in function, 24
linkedin.get_profile(), 13 linkedin.enter_job_location()
linkedin.groups_results(), 18 built-in function, 11
linkedin.jobs_results(), 14 linkedin.follow_company()
linkedin.join_group(), 18 built-in function, 12
linkedin.keypress(), 24 linkedin.get_comments()
linkedin.login(), 9 built-in function, 19
linkedin.login_cookie(), 20 linkedin.get_company_profile()
linkedin.open(), 23 built-in function, 13
linkedin.open_connections(), 15 linkedin.get_current_url()
linkedin.people_results(), 14 built-in function, 24
linkedin.posts_links(), 20 linkedin.get_feed()
linkedin.posts_results(), 15 built-in function, 17
linkedin.quit(), 25 linkedin.get_job_profile()
linkedin.reload(), 24 built-in function, 10
linkedin.scroll(), 24 linkedin.get_messages()
linkedin.search(), 9 built-in function, 16
linkedin.search_companies(), 17 linkedin.get_page_source()
linkedin.search_groups(), 18 built-in function, 23
linkedin.search_jobs(), 10 linkedin.get_page_title()
linkedin.search_people(), 10 built-in function, 23
linkedin.search_posts(), 11 linkedin.get_post()
linkedin.send_connection(), 12 built-in function, 19
27
linkedin-api-datakund, Release 0.0.2
linkedin.get_profile()
built-in function, 13
linkedin.groups_results()
built-in function, 18
linkedin.jobs_results()
built-in function, 14
linkedin.join_group()
built-in function, 18
linkedin.keypress()
built-in function, 24
linkedin.login()
built-in function, 9
linkedin.login_cookie()
built-in function, 20
linkedin.open()
built-in function, 23
linkedin.open_connections()
built-in function, 15
linkedin.people_results()
built-in function, 14
linkedin.posts_links()
built-in function, 20
linkedin.posts_results()
built-in function, 15
linkedin.quit()
built-in function, 25
linkedin.reload()
built-in function, 24
linkedin.scroll()
built-in function, 24
linkedin.search()
built-in function, 9
linkedin.search_companies()
built-in function, 17
linkedin.search_groups()
built-in function, 18
linkedin.search_jobs()
built-in function, 10
linkedin.search_people()
built-in function, 10
linkedin.search_posts()
built-in function, 11
linkedin.send_connection()
built-in function, 12
linkedin.send_message()
built-in function, 11
linkedin.send_message_by_name()
built-in function, 16
linkedin.unfollow_company()
built-in function, 12
linkedin.upload_content()
built-in function, 16
28 Index