Question: 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

Answer: 
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.
When the button clicked, you can post the data into the same page. Then with the variables you posted, you use cURL.