I'm a little new to using php crawlers. I am trying to use Goutte to download an excel file that is accessed by clicking on an "img" element, which is surrounded by an anchor tag - which executes an "onclick" event to gather headers and data for a post request. Here is what the html looks like on the site I am trying to access the excel file:
<div class="btncon">
<form method="post" id="export_selection" action="">
<input type="hidden" name="selected_for_export" id="selected_for_export">
<input type="hidden" name="selected_for_export_order" id="selected_for_export_order" value="desc">
<input type="hidden" name="selected_for_export_order_field" id="selected_for_export_order_field" value="_id_">
<input type="hidden" name="search_key" id="selected_for_export_search_key" value="">
</form>
<a onclick="return check_and_export();" href="javascript:void(0);"><img src="//assets.emailmeform.com/images/exportbtn.gif?RU1GLTAyLTI5" alt="Export"></a>
<a href="#"><img onclick="confirm_delete();return false;" src="//assets.emailmeform.com/images/deletebtn.gif?RU1GLTAyLTI5" alt=" "></a>
<!--
<button onclick="save_grid_preference();">Save Layout</button>
-->
<form onsubmit="set_search();return false;" lpformnum="1">
<div id="search_wraper">
<a href="https://app.emailmeform.com/builder/forms/entries_search/3693462" target="_blank"><span title="Advanced Search"> </span></a>
<input type="text" id="search_bx" class="search" value="">
</div>
</form>
</div>
I've made it to this page, now how do I use Goutte and/or GuzzleHttp to click on the "export" image and download the excel file after I get the response?
You are right, it's impossible with Goutte.
Try to use Mink instead, it supports JS execution though Selenium driver.