title: php - webscraping - clicking an ajax call then scraping page (can do it in python)
body: <p>I have some code in python that scrapes a page and finds all elements with the class name 'group-head' and clicks them to generate a page with all ajax calls performed. This works in python but I wanted to know if it can be done on curl/php coding?</p>
  
  <pre><code> # Get scraping...
  tree = parseLxml(driver=driver, url=url) # Go to URL and parse
  elem = driver.find_elements_by_class_name('group-head') # Use ChromeDriver to find element to get to the Ajax call
  for x in range(0,len(elem)): # Loop through all such elements
      try:  
          time.sleep(0.5)
          elem[x].click() # Click the element
          time.sleep(1.5) # Too fast and errors can occur, so wait...
      except:
          pass
  newpage = driver.page_source # Need to get page source again now all visible
  newtree = html.fromstring(newpage)
  match = newtree.xpath('//td[contains(@class,"score-time")]/a/@href') # Scrape match link
  base = 'http://uk.soccerway.com'
  for m in match:
      mURL = base+str(m)
      print ('Match URL:',mURL)
  </code></pre>