Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9007987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:50:04+00:00 2026-06-16T01:50:04+00:00

I am working with a parsing an HTML table in Perl using HTML::Query. I

  • 0

I am working with a parsing an HTML table in Perl using HTML::Query. I want to go through each row of the table and look at a certain cell. However, when I use this query…

my @resultsrows = $query->query('table#player_matches.tabelle_grafik tr')->get_elements();

…I run into a problem where each row of this outermost table is not represented alone. What I mean is, while the first element of this array is the first row in the outermost table I am working with, the second one refers to another table row within that first row because one of the cells has a completely new table within it.

For further explanation; when I try to loop through it:

for(my $i = 1; $i < @resultsrows; $i++) {
    @currentrow = $query->query('td span'); ## The cell I am looking for is the only one with a span.
    if($currentrow[0]->attr('title') eq $searchterm) {
        $returnedIndex = $i;
    }
}

Is there any CSS selector that I can use in this query that will allow me to select only the outermost table and avoid this problem? Would HTML::Tree help with this?

EDIT: I have tried to use > to denote only direct children, but it is not gathering any rows then: my @resultsrows = $query->query('table#player_matches.tabelle_grafik > tr')->get_elements();

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:50:05+00:00Added an answer on June 16, 2026 at 1:50 am

    Perhaps you’re working with a DOM that collects all tr children of a table within a tbody (which is what browsers usually do).

    Does this work?

    @resultsrows = $query->query('table#player_matches.tabelle_grafik > tbody > tr')->get_elements();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've working on parsing an input, which is HTML. However, I need to be
A web app I'm working on requires frequent parsing of diverse web resources (HTML,
I am working on the parsing of a HTML file containing many special characters
I'm trying to capture certain parts of HTML using regular expressions, and I've come
I'm working in Python with HTML that looks like this. I'm parsing with lxml,
I have a several tables nested within a table that I am parsing using
I am working on a project that will involve parsing HTML. After searching around,
I have an HTML document, and I want to parse out a table with
I was working on a project which required pulling down and parsing a .html
I am parsing an HTML file and having a few issues. I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.