Re: help with cURL + PHP
Scott Battersby <[email protected]> Tue, 4 Nov 2014 20:39:27 +1030
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <CACv0zNqRsJfPq0L1DR6Fjs21n2AfdzjOSQLiGTRivb2g4=4+Rw@mail.gmail.com> |
--===============0331579791== Content-Type: multipart/alternative; boundary=089e014942108acc3c050705a8cd --089e014942108acc3c050705a8cd Content-Type: text/plain; charset=UTF-8 Yes, that's my understanding. PHP can't fill those inputs because PHP is running on the webserver but the inputs are inside the browser. PHP can't reach them. On Tuesday, 4 November 2014, Mladen Jovic <[email protected]> wrote: > So if i understand there is no easy way to fill up those inputs throught > php even if i fill up manually CAPTCHA? :( > > > From: [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');> > > Date: Tue, 4 Nov 2014 19:01:10 +1030 > > Subject: Re: help with cURL + PHP > > To: [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');> > > > > I think the problem is more fundamental. cURL isn't useful for > > filling in forms. What cURL could do for you is to simulate sending > > ("POSTing") a completed form to the form target... ie simulate what > > happens after a human fills in the fields and then clicks the "Isci" > > button. You can read about the POST process here... it's a > > fundamental part of the internet : > > http://en.wikipedia.org/wiki/POST_(HTTP) > > > > So, can we do this with cURL in your application? Turns out to be > > pretty hard... it's not just a "normal" POST. > > > > If you examine the page source at > > https://raz.zav-zdruzenje.si/infocenter/Search.aspx you'll see that > > clicking the Isci button runs some javascript.... so you could dig > > into that javascript and see how it works, then simulate THAT with > > cURL. The javascript most likely carries out a POST, and probably > > some other processing... so you'd have to simulate the other > > processing in PHP and then do the POST with cURL. Of course you'd > > also need to get the captcha solved somehow... perhaps with a service > > like http://www.deathbycaptcha.com/ > > > > An alternative approach, if you are happy to solve the captcha > > yourself and just want to save time filling in the other fields is to > > use a windows machine and control Internet Explorer through vb or vba. > > Here's a rough example to get you started : > > http://www.excely.com/excel-vba/ie-automation.shtml > > > > Good luck :) > > > > Scott > > --089e014942108acc3c050705a8cd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, that's my understanding.=C2=A0 PHP can't fill those inputs bec= ause PHP is running on the webserver but the inputs are inside the browser.= =C2=A0 PHP can't reach them. =C2=A0<br><br>On Tuesday, 4 November 2014,= Mladen Jovic <<a href=3D"mailto:[email protected]">mladen.jovic@= hotmail.com</a>> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma= rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div><div dir=3D"ltr">So if i understand there is no easy way to fill up th= ose inputs throught php even if i fill up manually CAPTCHA? :(<br><br><div>= > From: <a href=3D"javascript:_e(%7B%7D,'cvml','scott@stopth= atsnoring.com.au');" target=3D"_blank">[email protected]</a>= <br>> Date: Tue, 4 Nov 2014 19:01:10 +1030<br>> Subject: Re: help wit= h cURL + PHP<br>> To: <a href=3D"javascript:_e(%7B%7D,'cvml',= 9;[email protected]');" target=3D"_blank">[email protected]= x.se</a><br>> <br>> I think the problem is more fundamental. cURL is= n't useful for<br>> filling in forms. What cURL could do for you is= to simulate sending<br>> ("POSTing") a completed form to the = form target... ie simulate what<br>> happens after a human fills in the = fields and then clicks the "Isci"<br>> button. You can read a= bout the POST process here... it's a<br>> fundamental part of the in= ternet :<br>> <a href=3D"http://en.wikipedia.org/wiki/POST_(HTTP)" targe= t=3D"_blank">http://en.wikipedia.org/wiki/POST_(HTTP)</a><br>> <br>> = So, can we do this with cURL in your application? Turns out to be<br>> = pretty hard... it's not just a "normal" POST.<br>> <br>>= ; If you examine the page source at<br>> <a href=3D"https://raz.zav-zdru= zenje.si/infocenter/Search.aspx" target=3D"_blank">https://raz.zav-zdruzenj= e.si/infocenter/Search.aspx</a> you'll see that<br>> clicking the Is= ci button runs some javascript.... so you could dig<br>> into that javas= cript and see how it works, then simulate THAT with<br>> cURL. The java= script most likely carries out a POST, and probably<br>> some other proc= essing... so you'd have to simulate the other<br>> processing in PHP= and then do the POST with cURL. Of course you'd<br>> also need to = get the captcha solved somehow... perhaps with a service<br>> like <a hr= ef=3D"http://www.deathbycaptcha.com/" target=3D"_blank">http://www.deathbyc= aptcha.com/</a><br>> <br>> An alternative approach, if you are happy = to solve the captcha<br>> yourself and just want to save time filling in= the other fields is to<br>> use a windows machine and control Internet = Explorer through vb or vba.<br>> Here's a rough example to get you s= tarted :<br>> <a href=3D"http://www.excely.com/excel-vba/ie-automation.s= html" target=3D"_blank">http://www.excely.com/excel-vba/ie-automation.shtml= </a><br>> <br>> Good luck :)<br>> <br>> Scott<br><br></div> = </div></div> </blockquote> --089e014942108acc3c050705a8cd-- --===============0331579791== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg== --===============0331579791==--