Hello All,

I really need help, I have no experience with Curl and I want to use it to perform simple actions on a "software as a service" application, the goal is to automate testing, using tools like "selenium" is much more easier but not enough powerful to develop in the future automatic scripts that can be launched as a cron job for example

I downloaded curl.exe version 7.19.5 and tried basic commands on the command prompt , there are returned results but the data returned is very complex, it seems that using curl library with PHP is easier than a pure curl usage but I have no choice and I need to use only the curl.exe file

the text was very long, I just tried to explain precisely what the problem is to save time

we can summarize the issue in "how to use curl to perform basic UI actions as in selenium and gather results"


9 Years
Discussion Span
Last Post by cwarn23

Well curl on its own actually hasn't got anything to do with php. Curl is a programming language which can be found at wikipedia and Curl is even a mathematics calculation. So as you can see, the name Curl is known to be a number of things but the one in php is actually called Client URL Library. The Client URL Library (php-curl) is open source so if you know c++/c then you should be able to download the source and embed it into your program. I'm assuming that's what you want.


Thank you for the feedback, but the problem I have is that I'm not authorized to use the php, only curl scripting language, I performed a simple test on the google website to see if I can get results: the command I wrote and the very ugly returned stuff are pasted below:
C:\Documents and Settings\admin\Desktop\Curl\curl-7.19.5 (working)>curl "www.goo
<html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><t
itle>403 Forbidden</title><style><!--body {font-family: arial,sans-serif}div.nav
{margin-top: 1ex}div.nav A {font-size: 10pt; font-family: arial,sans-serif}span
.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}div.nav
A,span.big {font-size: 12pt; color: #0000cc}div.nav A {font-size: 10pt; color: b
lack}A.l:link {color: #6f6f6f}A.u:link {color: green}//--></style><script><!--va
r rc=403;//--></script></head><body text=#000000 bgcolor=#ffffff><table border=0
cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap><b><fo
nt face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=
10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color
=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font fa
ce=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b><td>&nbsp;</td></tr><tr><
td bgcolor="#3366cc"><font face=arial,sans-serif color="#ffffff"><b>Error</b></t
d></tr><tr><td>&nbsp;</td></tr></table><blockquote><H1>Forbidden</H1>Your client
does not have permission to get URL <code>/search?q=zied&amp;btnG=Google%20Sear
ch</code> from this server. (Client IP address:<br><br>
Please see Google's Terms of Service posted at http://www.google.com/terms_of_se
<BR><BR><P>If you believe that you have received this response in error, please
<A HREF="http://www.google.com/support/bin/request.py?contact_type=user&hl=en">r
eport</A> your problem. However, please make sure to take a look at our Terms of
Service (http://www.google.com/terms_of_service.html). In your email, please se
nd us the <b>entire</b> code displayed below. Please also send us any informati
on you may know about how you are performing your Google searches-- for example,
"I'm using the Opera browser on Linux to do searches from home. My Internet ac
cess is through a dial-up account I have with the FooCorp ISP." or "I'm using th
e Konqueror browser on Linux to search from my job at myFoo.com. My machine's I
P address is, but all of myFoo's web traffic goes through some kind
of proxy server whose IP address is" (If you don't know any inform
ation like this, that's OK. But this kind of information can help us track down
problems, so please tell us what you can.)</P><P>We will use all this informati
on to diagnose the problem, and we'll hopefully have you back up and searching w
ith Google again quickly!</P>
<P>Please note that although we read all the email we receive, we are not always
able to send a personal response to each and every email. So don't despair if
you don't hear back from us!</P>
<P>Also note that if you do not send us the <b>entire</b> code below, <i>we will
not be able to help you</i>.</P><P>Best wishes,<BR>The Google Team</BR></P><BLO

<p></blockquote><table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor="#
3366cc"><img alt="" width=1 height=4></td></tr></table></body></html>


That basically returned the page source. To filter it you would need to place that data into a variable then use the regex library to filter it. I'm not sure but you might be able to use variables in the command terminal. But why is it you can't use php as a cron job. Isn't it like standard? The following is an example command:

php /home/www/cron.php

If however you are looking for something that is client side and not server side I would suggest looking at php-gtk for windows.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.