The objective of this tutorial is to build a simple job search API with Strapi and Puppeteer. Strapi is an open-source Headless CMS written in Node...
For further actions, you may consider blocking this person and/or reporting abuse
Great article, testing it out and new to JS.
I notice that "li.result-card.job-result-card" is no longer working.
Can you please update or point to me to what I should look for?
If the selector doesn't work, you can go to the Linkedin job search with your browser a copy the
li
selector in the DEV tools.Dude this is great man, I got it to work and thanks for teaching me.
Here is the update li to update:
li.result-card.job-result-card.result-card--with-hover-state.job-card__contents--active
Thank you, Sif!
Well, it seems that the selector in the tutorial is still working
li.result-card.job-result-card
. Be careful, the selector in your reply will select only theactive
list item (as you can see, the.job-card__contents--active
is the active CSS class for a selected list item). We need all the list items (not just the selected one) so you need to get a more generic selector.Thanks for that, I will give that a try
I followed the steps to the letter, but don't see jobs turning up in my admin page. I see GETs ongoing in my terminal, so I suppose that means that the data is being fetched? If I am not mistaken?
Hello Dushyant,
Can you see your content type in the Strapi admin page? Can you share your CRON task script please?
Thanks for the reply, sir.
Yes, I can see the content-type, Jobs, in the admin page.
Here is my CRON script(functions/cron.js)
gist.github.com/dkp1903/d598e143ea...
Your welcome.
Well, it should work. Can you confirm that your Strapi server CRON configuration is set to true in
config/environments/development/server.json
.Also, keep in mind that the CRON task in this example will be executed every 24 hours. Did you wait 24 hours to test the case? Maybe you should modify the CRON expression to execute your script every minutes just to test if the script works well.
Don't forget to stop the server after the test :D
It works, sir. Forgot about the 24 hour thing. Switched it to a minute and it works right as rain.
Thanks a million!
Don't mean to be a killjoy, but the LinkedIn part seems to be a violation of the LinkedIn ToS
linkedin.com/help/linkedin/answer/...
LinkedIn has banned users for seemingly harmless apps in the past. Can you update the article to use another site as an example?
Nice!
Tip:
/Users/helabbassi/perso/
should be replaceable with~
.Oh thank you Dan !
What is the vest way to manage authentication with puppeteer ? To have access to our own data in linkedin
Hi Lucas,
I didn't have time to test that solution (and I think it isn't the best way to do this) but I think you will need to sign in to Linkedin with your browser (to start a session) and find the
li_at
cookie in the DEV tools. Then, you will be able to set this cookie before navigating to Linkedin (just before theawait page.goTo(...)
)I really recommend you to create a simple function to check if you are logged in or not. Something like
I think this function needs to be called after the
setCookie
because your Linkedin session can be finished.Feel free to add some additional information about this solution or suggest a better way to do that.
Great tutorial! Keep it up!
Thank you, Victor.
Thanks for this! I was already building out a job board using Strapi and was manually inputting some of the things. This was a huge help to get some other data.