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 7944645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:36:49+00:00 2026-06-04T00:36:49+00:00

I’m trying to parse some parts of an HTML page but I have problems

  • 0

I’m trying to parse some parts of an HTML page but I have problems with my regular expression.
My code looks like this:

... Download page using wget and some other stuff ...

$PAGE_REGEXP = "\<div class="col bg_dark clear">";

#Array HTMLLines
@HTMLLines = split(/\n/, $Page);
foreach $ThisOne (@HTMLLines) {
    if ( ($Team) = ($ThisOne =~ /$PAGE_REGEXP/) ) {
        $T{TranslateTeams($Team)}++;
        $LastTeam=TranslateTeams($Team);
    };
};

This is the HTML page:

<div class="col bg_dark clear">
    <div class="col_1 left">15:30</div>
    <div class="col_3_archive left">Team A - Team B</div>
    <div class="col_2_archive left">
            1:4 (0:2)&nbsp;
    </div>

    <div class="col_5 left ">2.4&nbsp;</div>
    <div class="col_5 left ">3.6&nbsp;</div>
    <div class="col_5 left bold">2.9&nbsp;</div>
    <div class="col_8 left">
</div>

<div class="col  clear">
    <div class="col_1 left">15:30</div>
    <div class="col_3_archive left">Team C - Team D</div>
    <div class="col_2_archive left">
            2:3 (1:1)&nbsp;
    </div>

    <div class="col_5 left ">2.7&nbsp;</div>
    <div class="col_5 left ">3.7&nbsp;</div>
    <div class="col_5 left bold">2.5&nbsp;</div>
    <div class="col_8 left">
</div>

The informations I need to parse are the team names, the end and halftime result and the numbers in e.g., col_5_left: 2.4, 3.6 and 2.9(for the game Team A – Team B).

If I start my script, Perl gives me following error:
Bareword found where operator expected at parser.pl line 11, near “”\

I’m not familiar with all existing modules in Perl, maybe I’m trying to do something which is quite easily to achieve using
the correct module. Can anybody please provide me some hints/tips how to parse this HTML page?

Thx

  • 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-04T00:36:52+00:00Added an answer on June 4, 2026 at 12:36 am

    The line with regexp should probably look something like this:

    $PAGE_REGEXP = '<div class="col bg_dark clear">';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.