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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:16:09+00:00 2026-05-26T11:16:09+00:00

$p = new DOMDocument(); echo $data; $static = $p->loadHTML($data); $static = $static->getElementByTagName(html)->item(0); $static =

  • 0
$p = new DOMDocument();
echo $data;
$static = $p->loadHTML($data);
$static = $static->getElementByTagName("html")->item(0);
$static = $static->getElementByTagName("body")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(0);
$static = $static->getElementByTagName("td")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(5);
$static = $static->getElementByTagName("td")->item(1);
$static = $static->getElementByTagName("div")->item(0);
$static = $static->getElementByTagName("table")->item(0);
$static = $static->getElementByTagName("tr")->item(0);
$static = $static->getElementByTagName("td")->item(0);
$static = $static->etElementByTagName("center")->item(0);
echo $static;

Thats my code above, im not sure if I am doing it correctly but it seems like its right (Im trying to basically go through the structure to find the exact part I need). However I keep getting this error:

Fatal error: Call to a member function getElementByTagName() on a non-object in blah on line 18

(Line 18 being the first “getElementByTagName”)

I also get these errors if its anything to do with it:

Warning: DOMDocument::loadHTML()
[domdocument.loadhtml]: Opening and
ending tag mismatch: td and center in
Entity, line: 83 in
on line 17

Warning: DOMDocument::loadHTML()
[domdocument.loadhtml]: Opening and
ending tag mismatch: td and center in
Entity, line: 83 in
on line 17

Warning: DOMDocument::loadHTML()
[domdocument.loadhtml]: Opening and
ending tag mismatch: td and center in
Entity, line: 87 in
on line 17

Warning: DOMDocument::loadHTML()
[domdocument.loadhtml]: Unexpected end
tag : div in Entity, line: 91 in
on line 17

but yeah, can anyone help please?

  • 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-26T11:16:09+00:00Added an answer on May 26, 2026 at 11:16 am

    You have mistyped the function name as getElementByTagName. The correct function name is getElementsByTagName. When I repeated your code with this correction it worked properly.

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

Sidebar

Related Questions

This is my code: $oDom = new DOMDocument(); $oDom->loadHTML(èàéìòù); echo $oDom->saveHTML(); This is the
I'm trying to remove all body children with DOMDocument. $dom = new DomDocument(); $dom->loadHTML($buffer);
My PHP code $dom = new DOMDocument(); @$dom->loadHTML($file); $xpath = new DOMXPath($dom); $tags =
$xml = file_get_contents(example.com); $dom = new DomDocument(); $dom->loadXML($xml); $items = $dom->documentElement; foreach($items->childNodes as $item)
I'm using domdocument to create an xml file: $dom = new DOMDocument('1.0', 'iso-8859-1'); echo
the result of the following domdocument() call $html = <<<EOT <div class=list_item> <div class=list_item_content>
Private Sub Command1_Click() Dim dom As New DOMDocument Dim http As New XMLHTTP Dim
For example, I write a method: Private Sub Command1_Click() Dim dom As New DOMDocument
<?php $doc = new DOMDocument(); $doc->load('http://weather.yahooapis.com/forecastrss?p=VEXX0024&u=c'); $channel = $doc->getElementsByTagName(channel); foreach($channel as $chnl) { $item
I'm using the a wrapper around the PHP5-class DOMDocument to generate my HTML. This

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.