> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapegraphai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 📰 Wired Articles

> How to extract articles from Wired.com

<img style={{ borderRadius: '0.5rem' }} src="https://mintcdn.com/scrapegraphaiinc-9e950277/4qVtSM5IjLHD2i2B/cookbook/images/wired-banner.png?fit=max&auto=format&n=4qVtSM5IjLHD2i2B&q=85&s=18b3b5dfb2d0a627e91b43c8d7389d00" width="1584" height="396" data-path="cookbook/images/wired-banner.png" />

[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ScrapeGraphAI/scrapegraph-py/blob/main/cookbook/wired-news/scrapegraph_sdk.ipynb) [![View on GitHub](https://img.shields.io/badge/GitHub-View_Notebook-181717?logo=github)](https://github.com/ScrapeGraphAI/scrapegraph-py/blob/main/cookbook/wired-news/scrapegraph_sdk.ipynb)

Learn how to extract article information from Wired.com using ScrapeGraphAI's Extract service. This example demonstrates how to gather article details, categories, and author information.

## The Goal

We'll extract the following article information:

| Field    | Description                                      |
| -------- | ------------------------------------------------ |
| Category | Article category (e.g., 'Health', 'Environment') |
| Title    | Article headline                                 |
| Link     | URL to the full article                          |
| Author   | Writer's name                                    |

## Code Example

```python theme={null}
from pydantic import BaseModel, Field
from typing import List
from scrapegraph_py import ScrapeGraphAI

# Schema for a single news item
class NewsItemSchema(BaseModel):
    category: str = Field(description="Category of the news (e.g., 'Health', 'Environment')")
    title: str = Field(description="Title of the news article")
    link: str = Field(description="URL to the news article")
    author: str = Field(description="Author of the news article")

# Schema that contains a list of news items
class ListNewsSchema(BaseModel):
    news: List[NewsItemSchema] = Field(description="List of news articles with their details")

sgai = ScrapeGraphAI()  # reads SGAI_API_KEY from env

res = sgai.extract(
    "Extract latest news articles",
    url="https://www.wired.com/",
    schema=ListNewsSchema.model_json_schema(),
)

if res.status == "success":
    print(res.data.json_data)
```

## Example Output

```json theme={null}
{
    "news": [
        {
            "category": "Artificial Intelligence",
            "title": "The Race to Build Better Large Language Models",
            "link": "https://www.wired.com/story/the-race-to-build-better-llms",
            "author": "Will Knight"
        },
        {
            "category": "Security",
            "title": "The Latest Cybersecurity Threats You Need to Know About",
            "link": "https://www.wired.com/story/latest-cybersecurity-threats",
            "author": "Lily Hay Newman"
        },
        {
            "category": "Science",
            "title": "New Discoveries in Quantum Computing",
            "link": "https://www.wired.com/story/quantum-computing-discoveries",
            "author": "Steven Levy"
        }
    ]
}
```

<CardGroup cols={2}>
  <Card title="Extract" icon="robot" href="/services/extract">
    Learn more about our AI-powered extraction service
  </Card>

  <Card title="Python SDK" icon="python" href="/sdks/python">
    Explore our Python SDK documentation
  </Card>
</CardGroup>

***

<Note>
  Have a suggestion for a new example? [Contact us](mailto:contact@scrapegraphai.com) with your use case or contribute directly on [GitHub](https://github.com/ScrapeGraphAI/scrapegraph-sdk).
</Note>
