cURL script in PHP or Python, perl
I have in PHP a script that use multi curl to connect to sites doing the following actions:
- login to the site
- get a page
- verify the page content
- if the开发者_如何学C content is what I need I do 5.
- post some data to the site.
- log out.
My script can login to <20 sites in parallel, but is not too fast and is use a lot of server resources.
Can I convert the script to Python or other language to make it faster? I don't know if is possible to use a browser like firefox or other to send commands and get the content? Example:
system("firefox http://stackoverflow.com/users/login");
system("firefox post-data:username=stack&password=some");
system("firefox getcontent > mypage.html");
It may looks a crazy solution :) but I need to improve the performance of PHP script.
Thank you very much, Adrian
I'd imagine it has less to do with the language, and more to do with waiting for HTTP requests. It doesn't sound like you are doing anything that would cause PHP to be the bottleneck.
I'd start by testing the time it takes for the HTTP requests. I'll bet that's where your bottleneck is.
For python, try to use Mechanize
精彩评论