import requests
import json
import time
extract_rules = {
"jobs": {
"selector": ".job-card",
"type": "obj",
"multiple": True,
"children": {
"title": {"selector": "h2, h3", "type": "text"},
"company": {"selector": ".company-name", "type": "text"},
"location": {"selector": ".location", "type": "text"},
"salary": {"selector": ".salary", "type": "text"},
"url": {"selector": "a", "type": "link"}
}
},
"next_page": {"selector": "a[rel='next']", "type": "link"}
}
def scrape_jobs(search_url):
response = requests.post("https://api.ujeebu.com/scrape",
headers={
"ApiKey": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"url": search_url,
"js": True,
"wait_for": ".job-card",
"extract_rules": extract_rules
})
return response.json()["result"]
# Search for Python developer jobs
data = scrape_jobs("https://example-jobboard.com/search?q=python+developer")
print(f"Found {len(data['jobs'])} jobs")
for job in data['jobs'][:5]:
print(f"\n{job['title']}")
print(f" Company: {job['company']}")
print(f" Location: {job['location']}")
print(f" Salary: {job.get('salary', 'Not listed')}")
const axios = require('axios');
// Generic extract rules - adapt selectors to your target job board
const extractRules = {
jobs: {
selector: '.job-card',
type: 'obj',
multiple: true,
children: {
title: { selector: 'h2, h3, .job-title', type: 'text' },
company: { selector: '.company-name', type: 'text' },
location: { selector: '.location', type: 'text' },
salary: { selector: '.salary', type: 'text' },
url: { selector: 'a', type: 'link' }
}
},
next_page: { selector: "a[rel='next']", type: 'link' }
};
async function scrapeJobs(searchUrl) {
const response = await axios.post('https://api.ujeebu.com/scrape', {
url: searchUrl,
js: true,
wait_for: '.job-card',
extract_rules: extractRules
}, {
headers: {
'ApiKey': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
return response.data.result;
}
// Scrape developer jobs
const data = await scrapeJobs('https://example-jobboard.com/search?q=developer');
console.log(`Found ${data.jobs.length} jobs`);
data.jobs.slice(0, 5).forEach(job => {
console.log(`${job.title} at ${job.company}`);
console.log(` Salary: ${job.salary || 'Not listed'}`);
});
curl -X POST "https://api.ujeebu.com/scrape" \
-H "ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example-jobboard.com/search?q=python+developer","js":true,"wait_for":".job-card","extract_rules":{"jobs":{"selector":".job-card","type":"obj","multiple":true,"children":{"title":{"selector":"h2, h3","type":"text"},"company":{"selector":".company-name","type":"text"},"location":{"selector":".location","type":"text"},"salary":{"selector":".salary","type":"text"},"url":{"selector":"a","type":"link"}}},"next_page":{"selector":"a[rel=next]","type":"link"}}}'
from ujeebu_python import UjeebuClient
uj = UjeebuClient(api_key="YOUR_API_KEY")
res = uj.scrape_with_rules(
url="https://example-jobboard.com/search?q=python+developer",
extract_rules={
"jobs": {
"selector": ".job-card",
"type": "obj",
"multiple": True,
"children": {
"title": {
"selector": "h2, h3",
"type": "text"
},
"company": {
"selector": ".company-name",
"type": "text"
},
"location": {
"selector": ".location",
"type": "text"
},
"salary": {
"selector": ".salary",
"type": "text"
},
"url": {
"selector": "a",
"type": "link"
}
}
},
"next_page": {
"selector": "a[rel=next]",
"type": "link"
}
},
params={
"js": True,
"wait_for": ".job-card"
},
)
print(res.json())
const { UjeebuClient } = require('@ujeebu-org/ujeebu-sdk');
const client = new UjeebuClient("YOUR_API_KEY");
(async () => {
const res = await client.scrape("https://example-jobboard.com/search?q=python+developer", {
"js": true,
"wait_for": ".job-card",
"extract_rules": {"jobs":{"selector":".job-card","type":"obj","multiple":true,"children":{"title":{"selector":"h2, h3","type":"text"},"company":{"selector":".company-name","type":"text"},"location":{"selector":".location","type":"text"},"salary":{"selector":".salary","type":"text"},"url":{"selector":"a","type":"link"}}},"next_page":{"selector":"a[rel=next]","type":"link"}},
});
console.log(res.data);
})();
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ujeebu.com/scrape');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'ApiKey: ' . 'YOUR_API_KEY',
'Content-Type: application/json',
]);
$payload = [
'url' => 'https://example-jobboard.com/search?q=python+developer',
'js' => true,
'wait_for' => '.job-card',
'extract_rules' => [
'jobs' => [
'selector' => '.job-card',
'type' => 'obj',
'multiple' => true,
'children' => [
'title' => [
'selector' => 'h2, h3',
'type' => 'text'
],
'company' => [
'selector' => '.company-name',
'type' => 'text'
],
'location' => [
'selector' => '.location',
'type' => 'text'
],
'salary' => [
'selector' => '.salary',
'type' => 'text'
],
'url' => [
'selector' => 'a',
'type' => 'link'
]
]
],
'next_page' => [
'selector' => 'a[rel=next]',
'type' => 'link'
]
]
];
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"fmt"
"io"
"strings"
"net/http"
)
func main() {
url := "https://api.ujeebu.com/scrape"
payload := strings.NewReader(`{"url":"https://example-jobboard.com/search?q=python+developer","js":true,"wait_for":".job-card","extract_rules":{"jobs":{"selector":".job-card","type":"obj","multiple":true,"children":{"title":{"selector":"h2, h3","type":"text"},"company":{"selector":".company-name","type":"text"},"location":{"selector":".location","type":"text"},"salary":{"selector":".salary","type":"text"},"url":{"selector":"a","type":"link"}}},"next_page":{"selector":"a[rel=next]","type":"link"}}}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("ApiKey", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
package main
import (
"fmt"
"log"
"github.com/ujeebu/ujeebu-go"
)
func main() {
client, err := ujeebu.NewClient("YOUR_API_KEY")
if err != nil {
log.Fatal(err)
}
res, _, err := client.Scrape(ujeebu.ScrapeParams{
URL: "https://example-jobboard.com/search?q=python+developer",
ExtractRules: map[string]any{
"jobs": map[string]any{
"selector": ".job-card",
"type": "obj",
"multiple": true,
"children": map[string]any{
"title": map[string]any{
"selector": "h2, h3",
"type": "text",
},
"company": map[string]any{
"selector": ".company-name",
"type": "text",
},
"location": map[string]any{
"selector": ".location",
"type": "text",
},
"salary": map[string]any{
"selector": ".salary",
"type": "text",
},
"url": map[string]any{
"selector": "a",
"type": "link",
},
},
},
"next_page": map[string]any{
"selector": "a[rel=next]",
"type": "link",
},
},
JS: true,
WaitFor: ".job-card",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
}