Skip to content

find_element or find_elements doesn't work properly #265

@larscom

Description

@larscom

Hi,

I have a vec of Element types which i iterate over:

  for row in all_rows {
        let html = row.inner_html().await?;
        dbg!(&html);

        let tds = row.find_elements("td").await?;
        assert!(!tds.is_empty());

        dbg!(tds);
    }

This is the output of the dbg! html:

&html = Some( "\n<td class=\"item-icons\"><a href=\"https://example.com/download?id=12345\"><img src=\"/images/downarrow.png\" style=\"width:20px;\" title=\"Download Link\"></a></td><td class=\"list-item item-type\"><a href=\"/fullsearch?q=category:500\">Software</a> &gt; <a href=\"/fullsearch?q=category:510\">Utilities</a></td><td class=\"list-item item-name item-title\"><a href=\"javascript:void()\" onclick=\"prod12345.submit()\">SuperUtility Pro v2.0</a><form id=\"prod12345\" action=\"/product?id=12345\" method=\"POST\"> <input name=\"prod\" value=\"prod\" type=\"hidden\"></form></td><td class=\"list-item item-uploaded\">2025-08-15</td><td class=\"list-item item-size\">42.5&nbsp;MB<input type=\"hidden\" name=\"size\" value=\"44564432\"></td><td class=\"list-item item-seed\" style=\"color:green;\">256</td><td class=\"list-item item-leech\" style=\"color:#aaa;\">5</td><td class=\"list-item item-user\"><a href=\"/fullsearch?q=user:TechGuru\">TechGuru</a>\n</td>" );

Yet it can't find any <td> elements, it exits with an error.

Error: Chrome(Error { code: -32000, message: "Could not find node with given id" })

What am i missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions