Re: Extract specific div element from page
- From: frozendice@xxxxxxxxx ("Dan")
- Date: Fri, 15 Jun 2007 17:09:20 -0700
Or you could just use Javascript combined with PHP, just use javascript it's something like this document.getElementById('tagId').innerHtml that will give you the html(contents) of the <div> tag you specify. Then just do something like document.form.value = document.getElementById('tagId').innerHtml. Basicly you're setting a hidden form element to have the value of the div, then when you submit the page, you have the content as $_POST['formYouSetTo']. You could have the JS execute on the submit button's onclick.
It should be relatively easy if you look up the exact syntax of the javascript.
- Daniel
""Anthony Hiscox"" <distatica@xxxxxxxxxxxxx> wrote in message news:6dfcba5e0706151440p19d81dccrddda1633339827e5@xxxxxxxxxxxxxxxxx
Hey folks,.
I need to pull the contents inside of a specific div out of a page, and
write it to a separate file. In this instance I am taking everything inside
of <div id="content"></div> tags from a wordpress blog, this will give me
only the content and not the menus, or other stuff. I need to do this
because the final document will be converted for viewing on a palm pilot.
Is anyone aware of a simple solution to this problem, short of parsing the
entire page and starting when I hit that div opening tag, and stopping when
I hit the closing tag? One problem I can see with this method is that I
would have to count divs inside of that div, otherwise I would end too early
on.
Any advice would be greatly appreciated.
Peace and Love,
distatica.
--
---------------------------------
Anthony Hiscox
Video Watch Group
Public Site Currently Under Development
Group Members Site Fully Operational
---------------------------------
- Follow-Ups:
- Re: [PHP] Re: Extract specific div element from page
- From: "Anthony Hiscox"
- Re: [PHP] Re: Extract specific div element from page
- References:
- Extract specific div element from page
- From: "Anthony Hiscox"
- Extract specific div element from page
- Prev by Date: Re: [PHP] PHP Competition - Win a copy of Zend Studio
- Next by Date: [PHP] PHP Competition - Win a copy of Zend Studio
- Previous by thread: Extract specific div element from page
- Next by thread: Re: [PHP] Re: Extract specific div element from page
- Index(es):