To the developer thank you for making such an awesome library for me to use.
Running locally on the web browser / authenticated to LinkedIn everything works.
When running my script on a Cloud Service it prompts me with CHALLENGE
How would i go making this script headless?
Code is provided below
from linkedin_api import Linkedin
import base64
import pandas as pd
import database as db
import datetime as dt
# Authenticate using any Linkedin account credentials
def ProcessJobSpecs():
username = 'mysuperusername'
pwd = b'REDACTED'
pwd = base64.b64decode(pwd)
api = Linkedin(username, pwd)
company = api.search_companies('Google')
jobs = api.search_jobs('Google')
# with headers jobid, jobTitle, jobDescription create empty dataframe
df = pd.DataFrame(columns=['jobid', 'jobTitle', 'jobDescription', 'datetime'])
# loop through jobs and get job description
for job in jobs:
datetime = dt.datetime.now()
jobTitle = job['title']
jobid = job['dashEntityUrn'].split(':')[-1]
jobDetails = api.get_job(jobid)
jobspec = jobDetails['description']['text']
df = df.append({'jobid': jobid, 'jobTitle': jobTitle, 'jobDescription': jobspec, 'datetime': datetime}, ignore_index=True)
for index, row in df.iterrows():
data = {'jobid': row['jobid'], 'jobtitle': row['jobTitle'], 'jobdescription': row['jobDescription'], 'DateTime': row['datetime']}
# sanitize data escape single quotes
data['jobtitle'] = data['jobtitle'].replace("'", "''")
data['jobdescription'] = data['jobdescription'].replace("'", "''")
print(db.InsertJobSpec(data))
return 'Job Specs Processed'
ProcessJobSpecs()
To the developer thank you for making such an awesome library for me to use. Running locally on the web browser / authenticated to LinkedIn everything works.
When running my script on a Cloud Service it prompts me with
CHALLENGE
How would i go making this script headless?
Code is provided below