Skip to main content

social-media Scenario 5 — Wiki Search — Extract First Paragraph and Headings

Written by RTILA X Engineering Team

Advanced ~10 min
Prerequisites: social-media/3 social-media/4

What You'll Learn

Automate social media login and interaction

Real-World Use Case

Scheduling posts or scraping private data

LIVE DEMO

EXPECTED OUTPUT

RTILA X PROJECT JSON

    {
  "name": "Extract_Wiki_Search_Content",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/social-media/5"
    ]
  },
  "datasets": {
    "wiki_content": {
      "item_selector": "css=.wiki-results",
      "properties": [
        {
          "name": "first_paragraph",
          "type": "text",
          "selector": "css=.wiki-first-paragraph"
        },
        {
          "name": "sections",
          "type": "list",
          "selector": "css=.wiki-section-heading",
          "properties": [
            {
              "name": "heading",
              "type": "text",
              "selector": "css=self"
            }
          ]
        }
      ]
    }
  },
  "commands": [
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#wiki-search-input"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#wiki-search-input",
        "value": "artificial intelligence"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#wiki-search-btn"
      }
    },
    {
      "command": "click",
      "params": {
        "selector": "css=#wiki-search-btn"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.wiki-results"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "wiki_content"
      }
    }
  ]
}
  

Wiki pages commonly expose a first paragraph and a series of section headings. A list-type property can collect every heading with one selector.

Did you complete this scenario?

Ready to run this automation?

Copy the project JSON above, open RTILA X, create a new project, and paste it.

This scenario covers 3 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?