Prompt
What's the best way to scrape job listings?
Latest observation
Nov 20, 2026
OpenAI APIWeb search: off
The best way is usually not to scrape directly if you can avoid it—use an official API, RSS feed, partner feed, or data export first. It’s more stable, legal-safe, and less likely to break.
If you do need to collect job listings from websites, the best approach is:
-
Check the site’s terms and robots.txt
- Make sure scraping is allowed.
- Respect rate limits and crawl permissions.
-
Prefer structured sources
- Look for:
- JSON APIs
- HTML pages with embedded structured data like
schema.org/JobPosting - Sitemap or RSS feeds
- These are much easier and cleaner to parse.
- Look for:
-
Use a two-step crawler
- Discovery: gather listing URLs from search/result pages
- Extraction: fetch each listing page and parse the fields you need:
- title
- company
- location
- salary
- description
- posting date
- apply URL
-
Use the right tool
- For simple sites:
requests+BeautifulSoup - For JS-heavy sites:
PlaywrightorSelenium - For larger-scale crawling:
Scrapy - For static structured data: parse JSON-LD directly
- For simple sites:
-
Be polite and robust
- Add delays between requests
- Use retries with backoff
- Cache responses when possible
- Identify your crawler via a clear user agent
- Avoid hammering the site
-
Normalize and deduplicate
- Job listings often repeat across pages or over time.
- Store a canonical URL and use a hash of title/company/location/description to detect duplicates.
-
Handle anti-bot defenses carefully
- If a site blocks automation, don’t try to bypass protections.
- Instead, seek permission, use their API, or find another source.
Good default stack
- Scrapy for crawling at scale
- Playwright for dynamic pages
- PostgreSQL for storage
- BeautifulSoup / lxml for parsing
- pandas for cleanup and analysis
Recommended workflow
- Start with 1–2 target sites
- Inspect whether they expose
JobPostingJSON-LD - Build a parser for one listing page
- Add pagination and deduplication
- Monitor for layout changes
If you want, I can show you:
- a minimal Python scraper for job listings,
- a Scrapy project structure, or
- how to extract jobs from schema.org JSON-LD.