I'm working on a project of web scraping. Getting data from different online stores, but due to limitation of showing only a few records par page I can't get data in bulk without clicking the "show more" button at the bottom and in most cases that button is actually a span tag with just text in html mean with no achor tag. So how can I click that button in my php code. I'm using simple html dom parser php library for scraping.
Check for the id or class because most of the sites uses ajax call for the show more functionality
Have you tried echo a script to perform click?
<?php
echo '<script>
$(document).ready(function(){
$("#btn").click();
});
</script>';
?>
Using a headless web browser like PhantomJS or SlimerJS would be a better tool for the job, because that button is surely executing some javascript event(s) and dynamically modifying the DOM.
Otherwise, try looking at the network tab in something like Chrome dev tools and examine the format of the ajax requests that fetch more data when the more button is clicked. Then, see if you can simulate that request format to fetch multiple pages from php.