Jump to content

[SOLVED] DOM Help -- getElementById


peeps

Recommended Posts

I was trying to read in a web page from another site and all I want to look at is the div tag with a certain id.

I am able to get the element by using

echo $dom->getElementById('menubox')->tagName;

but all that tells me is that its a div tag. How do I print out what is in that div tag?

$dom = new DOMDocument;
$dom->validateOnParse = true;
@$dom->loadHTMLFile("myFileSomewhere.html");

echo $dom->getElementById('menubox')->tagName;

Thanks for the help.

Link to comment
https://forums.phpfreaks.com/topic/126644-solved-dom-help-getelementbyid/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.