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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

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

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 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

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

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

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»10th element in rating is not present so what should i do to print dash(-) in that place tto matchup the data frame

    10th element in rating is not present so what should i do to print dash(-) in that place tto matchup the data frame

    July 30, 2024

    import pandas as pd
    import selenium
    from selenium import webdriver
    from selenium.common.exceptions import NoSuchElementException
    import pandas as pd
    import time
    driver = webdriver.Chrome(r”C:Program Files (x86)chromedriver.exe”)
    driver.get(‘https://www.amazon.in/’)
    search_item = driver.find_element_by_xpath(“//input[@id =’twotabsearchtextbox’]”)
    search_item.send_keys(“Laptop”)

    serch_btn = driver.find_element_by_xpath(“//input[@id=’nav-search-submit-button’]”)
    serch_btn.click()

    cpu_filter = driver.find_element_by_link_text(‘Intel Core i7’).click()
    cpu2_filter = driver.find_element_by_link_text(‘Intel Core i9’).click()

    href = []
    lnks1=driver.find_elements_by_xpath(“//a[@class=’a-link-normal a-text-normal’]”)
    for lnk in lnks1:
    href.append(lnk.get_attribute(‘href’))
    href = href[0:10]
    print(len(href))

    Rating = []
    for i in href:
    driver.get(i)
    try:
    rating = driver.find_elements_by_xpath(“//*[@id=’reviewsMedley’]/div/div[1]/div[2]/div[1]/div/div[2]/div/span/span”)
    for i in rating:
    print(i.text)
    except:
    print(‘-‘)

    I’ve tried the above code, but because the 10th element doesn’t have any rating, I used try and except. However, it’s not working. It’s not reverting back the dash(-) and it is just printing the 9 elements.

    I want 10th element as dash(-) so that I could match up with at the time of creating dataframe.

    I am not getting any idea what to do next. Please help me out with this.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleApply a radom pacing in Jmeter without using Timers
    Next Article Appium 1.4.13 How to resolve error: Could not detect Mac OS X Version from sw_vers output: ‘10.12 ‘]?

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-48187 – RAGFlow Authentication Bypass

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    How to Do Laravel Performance Optimization by Detecting the Slower Parts of a Laravel Application

    Development

    My favorite Game Pass Soulslike just got a huge 2.0 update, and whoa, the patch even added a Friend’s Pass for free playing

    News & Updates

    If I Was Starting My Career Today: Thoughts After 15 Years Spent In UX Design (Part 1)

    Development

    CVE-2025-32963 – MinIO Operator STS Unauthenticated Kubernetes API Server Impersonation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    Linux

    Rilasciata Finnix 250: La distribuzione GNU/Linux per amministratori di sistema celebra 25 anni

    March 23, 2025

    Finnix, una distribuzione GNU/Linux basata su Debian creata da Ryan Finnie, è stata progettata specificamente…

    Microsoft resumes Windows 11 24H2 rollout to Release Preview Channel

    June 17, 2024

    How Can I Assess the Health of Our Test Pyramid in a Bug-Ridden Project?

    August 18, 2024

    Global Crackdown Leads to Seizure of Over 22,000 Malicious IPs, Servers

    November 5, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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