Save search results into csv file
5.1 Here is the content in result csv file:
5.2 Use python built-in module csv to save data into csv file
Python3
# Library for csv operations api import csv # Save the list of dicts info csv file def list_dict_to_csv(dicts, filename = "test.csv" ): # Open csv file and get file object with open (filename, 'w' , newline = '') as output_file: # Get csv header with the dicts keys keys = dicts[ 0 ].keys() # Initial DictWriter object dict_writer = csv.DictWriter(output_file, keys) # Write header into csv dict_writer.writeheader() # Write row datas into csv dict_writer.writerows(dicts) |
Automatically Get Top 10 Jobs from LinkedIn Using Python
Here we are going to use Clicknium to scrape LinkedIn top 10 jobs. First, we will login to LinkedIn to search the jobs according to the job keyword(the title, the skill, or the company) and the location, and then get the top 10 jobs in the search results. For each job, we will get the job information, such as the title, the company name, the size of the company, the post date, the job type, and the link URL. At last, we will save the results into CSV file.
The steps overview are as below:
- Login to LinkedIn
- Search jobs with the keyword and location
- Scrape the information of the top 10 jobs
- Save search results into csv file