Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends, I want to pull the number written in the "data-id" section from a page I have given the code below, but the result is blank.

<tr data-id="1104072624" class="searchResultsItem searchResultsPromoHighlight searchResultsPromoBold  searchResultsFireSale ">
    <td class="searchResultsLargeThumbnail" data-hj-suppress="">


The code I tried is as follows

What I have tried:

try:
    ino_info = driver.find_element(By.XPATH, f"/html/body/div[5]/div[4]/form/div[1]/div[4]/table/tbody/tr[{i}]/td[3]/div")
    ino = ino_info.get_attribute("data-id")
except:
    ino = "Blank"


help pls
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900