Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 14, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 14, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 14, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 14, 2025

      I test a lot of AI coding tools, and this stunning new OpenAI release just saved me days of work

      May 14, 2025

      How to use your Android phone as a webcam when your laptop’s default won’t cut it

      May 14, 2025

      The 5 most customizable Linux desktop environments – when you want it your way

      May 14, 2025

      Gen AI use at work saps our motivation even as it boosts productivity, new research shows

      May 14, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Strategic Cloud Partner: Key to Business Success, Not Just Tech

      May 14, 2025
      Recent

      Strategic Cloud Partner: Key to Business Success, Not Just Tech

      May 14, 2025

      Perficient’s “What If? So What?” Podcast Wins Gold at the 2025 Hermes Creative Awards

      May 14, 2025

      PIM for Azure Resources

      May 14, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Windows 11 24H2’s Settings now bundles FAQs section to tell you more about your system

      May 14, 2025
      Recent

      Windows 11 24H2’s Settings now bundles FAQs section to tell you more about your system

      May 14, 2025

      You can now share an app/browser window with Copilot Vision to help you with different tasks

      May 14, 2025

      Microsoft will gradually retire SharePoint Alerts over the next two years

      May 14, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Unable to get the correct value from the table using css selector in selenium

    Unable to get the correct value from the table using css selector in selenium

    November 19, 2024

    I am trying to get the value displayed against the Total using the below code:

    driver.get("https://www.cricbuzz.com/live-cricket-scorecard/20137/sl-vs-eng-4th-odi-england-tour-of-sri-lanka-2018");
    
    String textextras = driver.findElement(By.cssSelector("div[class='cb-col cb-col-100 cb-ltst-wgt-hdr']")).findElement(By.cssSelector("div:nth-last-child(3) div:nth-child(2)")).getText();
    System.out.println(textextras);
    
    String textsum = driver.findElement(By.cssSelector("div[class='cb-col cb-col-100 cb-ltst-wgt-hdr']")).findElement(By.cssSelector("div:nth-last-child(2) div:nth-child(2)")).getText();
    System.out.println(textsum);
    

    Output:

    19 Batsman R B 4s 6s SR

    Can anyone please help me why it is not working for textsum, but it is working fine for textextras variable ?

    Source: Read More

    Hostinger
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHow to add row elements in selenium?
    Next Article How to use Jmeter Xpath extractor for multiple run in dynamic API elements

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 15, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-30419 – NI Circuit Design Suite SymbolEditor Out-of-Bounds Read Vulnerability

    May 15, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    I cloni di Red Hat Enterprise Linux saranno mai all’altezza? AlmaLinux e Rocky Linux ci stanno provando in tutti i modi

    Linux

    DevOps Consulting: The Catalyst for Digital Evolution  

    Development

    Overwatch 2 Stadium Mode — Best Juno Builds: Best items, powers, and gameplay tips

    News & Updates

    I Paesi Europei Sviluppano un Supercomputer Basato su RISC-V: Tutto su EPAC1.5

    Linux

    Highlights

    Opera’s Tab Traces has a little trick to keep my browsing on track

    February 6, 2025

    Even the smallest feature can have a big impact. Now that Tab Traces has been…

    Best Free and Open Source Alternatives to Microsoft Paint

    June 21, 2024

    Microsoft and NVIDIA bring the Blackwell platform to Azure AI Foundry

    March 19, 2025

    Sitecore Awards Six Perficient Colleagues as MVPs in 2025

    January 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.