1

g day dear community - hello all!

well I am trying to select either a class or an id using PHP Simple HTML DOM Parser with absolutely no luck. Perhaps i have to study the manpages again and again.

Well - the DOM-technique somewhat goes over my head: But my example is very simple and seems to comply to the examples given in the manual (simplehtmldom.sourceforge AT net/manual.htm) but it just wont work, it's driving me up the wall. Other example scripts given with simple dom work fine.

See the example: http://www.aktive-buergerschaft.de/buergerstiftungsfinder

This is the easiest example i have found ... The question is - how to parse it?

Should i do it with Perl - The example HTML page is invalid HTML. I do not know if the Simple HTML DOM Parser is able to handle badly malformed HTML (probably not). And then i am lost.

Well: it is pretty hard to believe - but you can get the content with file_get_contents: But you afterwards have to do the parser job! And there i have some missing parts!

Finally: if i cannot get it to run i can try out some Perl parsers eg HTML::TreeBuilder::XPath

2
  • What doesn't work? Can you show some code? Commented May 24, 2011 at 17:06
  • hi Fosco hi Pekka, It is pretty hard to believe - but you can get the content with file_get_contents: But you afterwards have to do the parser job! And there is have some missing parts! Pekka and Fosco - can you help me here a bit!? Commented May 24, 2011 at 17:11

1 Answer 1

1

1: check whether file_get_contents is working!!!!

2: If no use curl or fopen or telnet to read the data.

Simple Html Dom filters all the noise can process malformed tags also...

Problem might be with your data retrieving

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.