Prompt

How do I extract table data from websites that only show it in HTML?

Technology / API Platforms2 observationsLast seen Oct 14, 2026

Latest observation

Oct 14, 2026OpenAI APIWeb search: off

If the data is already in the page’s HTML, you can usually extract it with a scraper by requesting the page and parsing the table tags.

Common approach

  1. Fetch the HTML

    • Use requests in Python or fetch/axios in JavaScript.
  2. Parse the HTML

    • Use BeautifulSoup (Python), lxml, or browser DOM parsing.
  3. Locate the table

    • Find <table>, <tr>, <th>, and <td> elements.
  4. Extract rows/cells

    • Convert them into a list, CSV, or DataFrame.

Python example with BeautifulSoup

import requests
from bs4 import BeautifulSoup

url = "https://example.com/page-with-table"
html = requests.get(url).text

soup = BeautifulSoup(html, "html.parser")
table = soup.find("table")

rows = []
for tr in table.find_all("tr"):
    cells = tr.find_all(["th", "td"])
    row = [cell.get_text(strip=True) for cell in cells]
    rows.append(row)

for row in rows:
    print(row)

Python example with pandas

If the table is well-formed HTML, pandas can do a lot of the work:

import pandas as pd

url = "https://example.com/page-with-table"
tables = pd.read_html(url)

df = tables[0]  # first table on the page
print(df)

This is often the easiest option.


If the table is loaded by JavaScript

Sometimes the HTML source doesn’t include the data directly, and it’s loaded after page load. In that case:

  • Inspect the page network requests in browser dev tools
  • Look for an API endpoint returning JSON
  • Or use a browser automation tool like:
    • Selenium
    • Playwright

Tips

  • Check the page source first to see whether the data is actually in the HTML.
  • Handle pagination if the table spans multiple pages.
  • Be careful with website terms of service and robots rules.
  • Add headers/user-agent if the site blocks simple requests.

If you want, I can show you how to extract a specific table from a real URL in Python or JavaScript.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.