# Extract apply links using OpenAI
apply_links = []
if html_content:
    try:
        completion = openai.ChatCompletion.create(
            model="gpt-4o",
            messages=[\
                {\
                    "role": "user",\
                    "content": prompt\
                }\
            ]
        )
        if completion.choices:
            result = json.loads(completion.choices[0].message.content.strip())
            apply_links = result['apply_links']
    except Exception as e:
        pass

```

### Step 6: Extract Job Details from Each Apply Link

We iterate over each apply link and use Firecrawl’s extraction capabilities to get job details.

```python