通过curl和PHP提交JavaScript点击

I am trying to scrap a web, On the main page, there are a few option buttons and then an ACCEPT button, and RESET button, when ACCEPT button is pressed after selecting appropriate option, new contents are displayed,

my question is, how can I sent a request through curl, when i inspect the ACCEPT button a JavaScript function is initiated, like

JavaScript:someFunction();

Can somebody guide me what should I do? how can I do it via curl and php? Or I should learn some new technique for this, my guess is, the ACCEPT button is sending an AJAX CALL,

guide me please

You need to call that ajax url using cURL and also set those desired variables along with proper values which are set after clicking that button. You can check cURL form posts.

Thanks.

Are you trying to simply click the button and submit the form? If that's the case, you can do that with plain javascript:

document.getElementById('acceptButtonId').click();

When the button clicked, you can post the data into the same page. Then with the variables you posted, you use cURL.