Parse a page

Asked

Viewed 251 times

0

I am trying to get the information from a page through the url. I am developing in symfony and using simple_html_dom or Crowler. But I’m nowhere near doing what I need to do.

The page I’m accessing is this: Events SESC São Carlos

What I want to do is take all the event titles. For while I have this code below where I take the page and give a find for the div with the class block_agenda-container which is the class that separates events. But nothing returns to me.

$html = new \simple_html_dom();
$html->load_file('http://www.sescsp.org.br/programacao/#/tagcloud=nuvem/ct=o-que-fazer');
$ret = $html->find('div[class=block_agenda-container]');
dump($ret);
die();
  • 1

    The content comes from Ajax requsitions. To get the data, directly request the source that returns the data that matters. The URL is this: http://www.sescsp.org.br/programacao/ajax/filtroView.action

  • I understand. But two questions: First how did you discover this? And second how would the request look?

  • Beauty for now and only a test, so I had asked with you found the rora, for in other pages I can do the same, in case you have used some tool or something of the type. But thanks!!!

  • 1

    @Marciusleandro you can discover the origin of an AJAX request via Firefox network inspector (or analogous tool, in Chrome). So you only need to filter by XHR. See an example here: http://stackoverflow.com/a/32719464/1262820

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.