Use job queue metadata instead of scraping page for title/company
Page scraping was grabbing wrong elements (e.g. "Location" instead of company name on Ashby). Queue already has correct metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,12 +19,10 @@ export async function apply(page, job, formFiller) {
|
|||||||
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: NAVIGATION_TIMEOUT });
|
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: NAVIGATION_TIMEOUT });
|
||||||
await page.waitForTimeout(PAGE_LOAD_WAIT);
|
await page.waitForTimeout(PAGE_LOAD_WAIT);
|
||||||
|
|
||||||
const meta = await page.evaluate(() => ({
|
const meta = {
|
||||||
title: document.querySelector('h1')?.textContent?.trim()?.slice(0, 100),
|
title: job.title,
|
||||||
company: document.querySelector('[class*="company"] h2, h2, [class*="employer"]')?.textContent?.trim()?.slice(0, 80),
|
company: job.company,
|
||||||
})).catch(() => ({}));
|
};
|
||||||
meta.title = meta.title || job.title;
|
|
||||||
meta.company = meta.company || job.company;
|
|
||||||
|
|
||||||
// Detect blockers: login walls, CAPTCHAs, closed listings
|
// Detect blockers: login walls, CAPTCHAs, closed listings
|
||||||
const pageCheck = await page.evaluate(() => {
|
const pageCheck = await page.evaluate(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user