Use PHP mimic web browser post form submission? Not cURL
I know how to submit post submissions by cURL - preparing all the variables (name & value pairs) and then submit. But what I want to do here is to mimic a real use click of the submit button.
So I use cURL to navigate to the web page that carries the ..., and then click "Submit" button. All the hidden v开发者_C百科ariables in are then automatically submitted as is. I don't have to prepare all the hidden variables manually as I would do in a normal cURL request.
Any idea? May be in combination with some JavaScript to mimic a browser?
It will be much easier to just parse the HTML of the page and get all input elements, and then use cURL to make the request.
Mimicking a browser is not trivial.
精彩评论