79720396

Date: 2025-07-30 18:43:46
Score: 1
Natty:
Report link

The issue you're encountering is likely because the Yahoo Finance page content is loaded dynamically with JavaScript, and rvest (which is based on static HTML parsing) can’t access the content that's rendered client-side.

3 Key Fixes:

  1. node_txt is not being passed correctly
    You wrote contains(@class, node_txt) this passes the literal string "node_txt" instead of the value. You need to interpolate the variable.

  2. Yahoo content loads dynamically
    Most fields like "Open", "Previous Close", etc., are rendered after JavaScript runs, so rvest won’t see them unless they’re in the static HTML.

  3. Better: Parse data from the page's embedded JSON
    Yahoo Finance embeds the full quote data in a JavaScript object you can parse it instead of scraping DOM nodes.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Muhammad Wasim