📰 IT NachrichtenToday’s NYT Mini Crossword Answers for Saturay, Sept. 12(12.09.2026 um 07:43 Uhr)
🔧 AI Nachrichten Etzioni on AI: What kids tell chatbots, but not you(04.09.2026 um 16:05 Uhr)
🔧 AI Nachrichten OpenAI Wants to Know if an AI Industry Slowdown Would Even Be Legal(11.09.2026 um 01:28 Uhr)
🔧 AI Nachrichten OpenAI puts Pro subscriptions on hold due to Astra demand(10.09.2026 um 22:59 Uhr)
🔧 AI Nachrichten OpenAI’s feud with mathematicians is only escalating(11.09.2026 um 22:57 Uhr)
📰 IT NachrichtenToday’s NYT Mini Crossword Answers for Saturay, Sept. 12(12.09.2026 um 07:43 Uhr)
🔧 AI Nachrichten Etzioni on AI: What kids tell chatbots, but not you(04.09.2026 um 16:05 Uhr)
🔧 AI Nachrichten OpenAI Wants to Know if an AI Industry Slowdown Would Even Be Legal(11.09.2026 um 01:28 Uhr)
🔧 AI Nachrichten OpenAI puts Pro subscriptions on hold due to Astra demand(10.09.2026 um 22:59 Uhr)
🔧 AI Nachrichten OpenAI’s feud with mathematicians is only escalating(11.09.2026 um 22:57 Uhr)

🔧 Programmierung 🕛 vor 2 Monaten 5 Min Lesezeit
0

Stop scraping the page when the data is already in the network tab

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

You write a scraper with Playwright, wait for the page to load, close the cookie banner, click a filter, and parse a table out of the DOM. Then someone redesigns the page and your selector breaks. The annoying part is that the data probably never lived in the HTML in the first place.



Most modern websites render a UI around structured background requests. The browser loads the shell, runs JavaScript, and calls internal endpoints for prices, availability, inventory, search results, profile data, or whatever the page needs. If you scrape the rendered page, you often process hundreds of kilobytes of layout and tracking code to recover a few kilobytes of JSON.






Look at the network layer before writing browser code



Before reaching for Playwright or Puppeteer, open DevTools and check what the site actually does.



In Chrome:




  1. Open DevTools

  2. Go to the Network tab

  3. Filter by Fetch/XHR

  4. Perform the action manually, such as search, filter, paginate, or change dates

  5. Click the request that returns the data

  6. Inspect the request URL, method, headers, payload, and response



You will often find something like this:




CODE
POST /api/search/hotels HTTP/2
content-type: application/json
x-csrf-token: 8f9c...

{
"checkIn": "2026-03-12",
"checkOut": "2026-03-15",
"city": "Berlin",
"guests": 2
}






And the response is already the thing you wanted:




CODE
{
"results": [
{
"id": "hotel_123",
"name": "Example Hotel",
"price": 184,
"currency": "EUR",
"available": true
}
]
}






At that point, scraping the DOM is extra work. You can reproduce the request directly:




CODE
curl 'https://example.com/api/search/hotels' \
-X POST \
-H 'content-type: application/json' \
-H 'x-csrf-token: 8f9c...' \
--data '{"checkIn":"2026-03-12","checkOut":"2026-03-15","city":"Berlin","guests":2}'






Or from code:




CODE
const res = await fetch('https://example.com/api/search/hotels', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-csrf-token': process.env.CSRF_TOKEN
},
body: JSON.stringify({
checkIn: '2026-03-12',
checkOut: '2026-03-15',
city: 'Berlin',
guests: 2
})
});

if (!res.ok) {
throw new Error(`Search failed: ${res.status} ${await res.text()}`);
}

const data = await res.json();
console.log(data.results.map(h => [h.name, h.price]));






This is the basic pattern: use the browser to discover the request, not to run every request forever.



is a managed version of this same approach rather than a DOM scraping wrapper.






When a browser is still the right tool



Use browser automation when the browser behavior is the thing you need to test or reproduce.



Good cases for Playwright, Puppeteer, or Selenium:




  • End-to-end testing user flows

  • Capturing screenshots or PDFs

  • Interacting with canvas-heavy or browser-only apps

  • Debugging frontend behavior

  • Handling flows where the data is only available after complex client-side state changes

  • Verifying that the UI actually displays what the API returned



Bad cases:




  • Polling prices every five minutes

  • Pulling paginated search results

  • Checking inventory across many SKUs

  • Feeding structured records into a data pipeline

  • Giving an agent live availability data



For those, inspect the network requests first. If the data is already JSON, call that layer directly, validate the response shape, and keep the browser out of the hot path unless you actually need it.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Seattle Times sues Microsoft and OpenAI, alleging they trained their AI on its journalism
1 Quelle
Today’s NYT Mini Crossword Answers for Saturay, Sept. 12
1 Quelle
Etzioni on AI: What kids tell chatbots, but not you
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stop scraping the page when the data is already in the network tab

Thematisch verwandte Begriffe: Stop, scraping, page, when · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...