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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:19:45+00:00 2026-05-19T14:19:45+00:00

I have got HTML source code, and i must get some information text in

  • 0

I have got HTML source code, and i must get some information text in the HTML. I can not use DOM, because the document isn’t well-formed.

Maybe, the source could change later, I can not be aware of this situation. So, the solution of this problem must be advisible for most situation.

Im getting source with curl, and i will edit it with preg_match_all function and regular expressions.

Source :

…
<TR Class="Head1">

<TD width="15%"><font size="12">Name</font></TD>

<TD>:&nbsp;</TD>

<TD align="center"><font color="red">Alex</font></TD>

<TD width="25%"><b>Job</b></TD>

<TD>:&nbsp;</B></TD>

<TD align="center" width="25%"><font color="red">Doctor</font></TD>

</TR>

…

…

<TR Class="Head2">

<TD width="15%" align="left">Age</B></TD>

<TD>:&nbsp;</TD>

<TD align="center"><font color="red">32</font></TD>

<TD width="15%"><font size="10">data</TD></font>

<TD>&nbsp;</B></TD>

<TD width="40%">&nbsp;</TD>

</TR>

…

As we have seen, the source is not well-formed. In fact, terrible! But there is nothing I can do.
The source is longer than this.

How can I get the data from the source? I can delete all of HTML codes, but how can i know sequence of data? What can I do with preg_match_all and regex? What else can I do?

Im waiting for your help.

  • 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-05-19T14:19:46+00:00Added an answer on May 19, 2026 at 2:19 pm

    If you can use the DOM this is far better than regexes. Take a look a PHP Tidy – it’s designed to manage badly formed HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got follow source code: <html> <head><script type=text/javascript> function test() { var links =
I've got some Javascript code which serializes the entire DOM tree as follows: (new
I'm trying to have my images source attributes to change when a certain button
I found this code in a couple of websites (http://goo.gl/usUSP): <?php // Basic request
I have a small client/server app that sends/receives UDP discovery packets. When a UDP
I have written a bash script to update a page on my company's website.
I've got autocomplete working fine, but I'm trying to figure out way to make
After shamelessly pilfering a code snippet from Tomas Petricek's Blog: http://tomasp.net/blog/csharp-fsharp-async-intro.aspx Specifically, this one
Last night when I asked about screen scraping I was given an excellent article
I am sending an AJAX request using javascript to a servlet. The servlet is

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.