0

I try to isert a stock-chart-module from an orther site into my own website.

As i use:

jimport('simplehtmldom.simple_html_dom');
// get DOM from URL or file
$html = file_get_html('http://www.raiffeisen.com/');
foreach($html->find('div#agrarfenster') as $element)
echo $element->innertext;

The Output will work. But i need this Code for the required output:

jimport('simplehtmldom.simple_html_dom');
// get DOM from URL or file
$html = file_get_html('http://www.raiffeisen.com/');
foreach($html->find('div#boersenfenster_bf_4562') as $element)
echo $element->innertext;

This Code would'nt work. But why?

My guess is that there are those underscores in the "boersenfenster_bf_4562".

Can somebody help me?

G.Wahlers
  • 11
  • 1
  • 1) Please fix your spelling errors 2) "The code wouldn't work" doesn't explain ... what happens? Do you get an exception? Does it not find any of the text? 3) suggest including a small sample showing the div's – Foon Sep 24 '15 at 13:51
  • That div doesn't have any inner text, check page source, and you will see... Rather let us know what you need? – sinisake Sep 24 '15 at 15:32
  • The first code gives the module on the right side from http://www.raiffeisen.com. But in the Output there is the

    -Tag from the title of the origin-module. But i only need the chart an the prices. The second code selects only these items i need. But why is there no output? P.S. If i could post images, i would do...

    – G.Wahlers Sep 24 '15 at 15:32
  • I need this for parser....
    etc.
    – G.Wahlers Sep 24 '15 at 15:37
  • This block is dynamically created, you will notice – sinisake Sep 24 '15 at 15:39
  • No, you will have to find another way to scrape this - this block is dynamically created by javascript, and simple html dom is not enough... http://stackoverflow.com/questions/24615745/how-to-scrape-dynamic-data-with-php-simple-html-dom-parser p.s. underscores aren't problem. – sinisake Sep 24 '15 at 16:00

0 Answers0