शुरू करेंमुफ़्त में शुरू करें

Order CSS selectors by the number of results

Depending on how many HTML elements of the same type there are on a web page, CSS selectors will return a different number of nodes. It's always good to have a certain idea about the magnitude of specific queries. This way you recognize when there is a problem, e.g., if your code returns a lot less elements than expected.

Given almost the same HTML as before:

<html> 
  <body> 
    <div>Python is perfect for programming. 
      <span>It even works for scraping!</span>
    </div>
    <p>Still, R is better suited for data analysis. 
      <span>But scraping is also a breeze.</span>
    </p>
    <small>(It has prettier charts, too.)</small>
  </body> 
</html>

यह अभ्यास पाठ्यक्रम का हिस्सा है

Web Scraping in R

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

हमारे इंटरैक्टिव अभ्यासों में से किसी एक के साथ सिद्धांत को व्यवहार में बदलें

अभ्यास शुरू करें