PromptBase
Close icon
General
Home
Marketplace
Hire
Create
Login
Sell
Explore
🤖 GPT

Generate Code To Scrape LinkedIn

Generate Code To Scrape LinkedIn gpt prompt mini thumbnail
115Eye icon
Views
GPT-4
TestedTick icon
TipsTick icon
This script makes a request to the LinkedIn profile page using the request-promise library, and then uses the cheerio library to parse the HTML and extract the profile name.
...more
$3.99
Get prompt
After purchasing, you will gain access to the prompt file which you can use with GPT or the app builder. You'll receive 20 free generation credits with this purchase. By purchasing this prompt, you agree to our terms of service.
Over 1 month ago

Prompt Details

Model
Chat - GPT-4 (gpt-4)
Token size
120 ($0.00360 / call)
Example input
const request = require('request-promise'); const cheerio = require('cheerio'); async function scrapeProfileName(url) { // Make a request to the LinkedIn profile page const html = await request(url); // Load the HTML into cheerio const $ = cheerio.load(html); // Find the element containing the profile name const nameElement = $('.pv-top-card-section__name'); // Extract the text from the element const name = nameElement.text(); return name; }
Example output
This code calls the scrapeProfileName function with the LinkedIn profile URL 'https://www.linkedin.com/in/john-doe/'. Once the function has finished scraping the profile and extracting the profile name, it will return a Promise object. The then method is called on the Promise object, which takes a callback function as an argument. This callback function will be executed when the Promise is resolved, with the resolved value (in this case, the profile name) passed as its argument. The callback function simply logs the profile name to the console using console.log. So, when this code is executed, the profile name of the LinkedIn profile located at the URL 'https://www.linkedin.com/in/john-doe/' will be scraped and logged to the console.
Browse Marketplace