[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Usando CURL para llenar formularios * Connection #0 to host



Listeros:

Buenas madrugadas (en Mexico)

Estoy aprendiendo a usar CURL y ya estuve haciendo muchisimas pruebas
y sin embargo no he tenido los resultados que necesito.

Estoy haciendo pruebas para llenar el formulario de O L X (anuncios)
se me ocurrio porque es muy sencillo (creo) no tiene CAPCHA ni otros
modos de verificacion..

Al revisar la web extraje la siguiente informacion:

--- FORM report. Uses POST to URL ""
Input: NAME="formHash" VALUE="bae5113a467eebcb37b5b89d1aacc7e0" (HIDDEN)
Input: NAME="categoryID" VALUE="280" (HIDDEN)
Input: NAME="countryID" VALUE="138" (HIDDEN)
Input: NAME="sessionHash" VALUE="81009487" (HIDDEN)
Input: NAME="categoryChild" VALUE="215" (HIDDEN)
Input: NAME="categoryParent" VALUE="185" (HIDDEN)
Input: NAME="listing_type" VALUE="2" (HIDDEN)
Input: NAME="_classifiedType" VALUE="0" (HIDDEN)
Input: NAME="title" (TEXT)
Input: NAME="max_orderAux" VALUE="1" (HIDDEN)
Input: NAME="imageQty" VALUE="0" (HIDDEN)
Input: NAME="f[${id}][order]" VALUE="21" (HIDDEN)
Input: NAME="f[${id}][edited]" VALUE="0" (HIDDEN)
Input: NAME="f[${id}][text]" VALUE="Descripción de la foto (Opcional)" (TEXT)
Input: NAME="sell_session" (HIDDEN)
Textarea: NAME="description"
Select: NAME="currency_typeC"
  Option VALUE="25"
  Option VALUE="11"
[end of select]
Input: NAME="C" (TEXT)
Input: NAME="priceC" (HIDDEN)
Select: NAME="priceType"
  Option VALUE="FIXED"
  Option VALUE="NEGOTIABLE" (SELECTED)
  Option VALUE="FREE"
[end of select]
Input: NAME="ad_language_id" VALUE="10" (HIDDEN)
Input: NAME="priority" (TEXT)
--- end of FORM
--- FORM report. Uses POST to URL ""
Input: NAME="identity" VALUE="1" (RADIO)
Input: NAME="identity" VALUE="2" (RADIO)
Input: NAME="contact-name" (TEXT)
Input: NAME="email" (TEXT)
Input: NAME="phone" (TEXT)
Select: NAME="state"
  Option VALUE="0"
  Option VALUE="6008"
[end of select]
Input: NAME="countryStateCityCase" VALUE="1" (HIDDEN)
Input: NAME="usesAutoComplete" (HIDDEN)
Input: NAME="useNeighborhoodMultiSelector" (HIDDEN)
Input: NAME="streetaddress" (TEXT)
Input: NAME="addresslat" (HIDDEN)
Input: NAME="addresslng" (HIDDEN)
--- end of FORM
--- FORM report. Uses POST to URL "http://www.olx.com.mx/posting_success.php";
Input: NAME="itemid" (HIDDEN)
Input: NAME="sh" (HIDDEN)
Button: "Publicar" (BUTTON)
--- end of FORM

Mi pregunta es ¿Tengo que poner todas las entradas o solo las que
estan marcadas como obligadas (marcadas con un * como esta en la
pagina web). Porque ya hice muchisimos intentos y no he podido llenar
este mentao formulario. Ya lo intente con todos los valores y solo con
los que marca obligatorios la pagina web y siempre al ejecutar curl me
sale la siguiente informacion.

(Estoy siendo breve con la informacion que estoy poniendo como ejemplo
en la ejecucion de curl)...

curl -F title="Vendo mi conocimiento en _Curl" -F description="Vendo
mi cochecito viejo" http://www.olx.com.mx/posting_success.php

* Hostname was NOT found in DNS cache
*   Trying 187.191.34.9...
* Connected to www.olx.com.mx (187.191.34.9) port 80 (#0)
> POST /posting_success.php HTTP/1.1
> User-Agent: Mozilla/5.0 (compatible; MSIE 7.01; Windows NT 5.0)
> Host: www.olx.com.mx
> Accept: */*
> Content-Length: 886
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------13a6b703ad479e0a
>
< HTTP/1.1 100 Continue
< HTTP/1.1 302 Moved Temporarily
* Server Apache/2.2.22 (Ubuntu) is not blacklisted
< Server: Apache/2.2.22 (Ubuntu)
< Location: posting.php
< Vary: Accept-Encoding
< Content-Encoding: gzip
< P3P: policyref="http://www.olx.com/w3c/p3p.xml";, CP="NON DSP COR CURa"
< Content-Length: 33
< Content-Type: text/html; charset=utf-8
< Date: Wed, 12 Nov 2014 07:29:18 GMT
< Connection: keep-alive
* HTTP error before end of send, stop sending
<
* Closing connection 0

Por logica me esta diciendo que no se pudo postear. Despues intento
otra opcion (a breves rasgos)...

curl --data "title='Vendo algo''&description='Vendo todo mi cochecito
viejo'&identity='2' http://www.olx.com.mx/posting_success.php

* Hostname was NOT found in DNS cache
*   Trying 187.191.34.9...
* Connected to www.olx.com.mx (187.191.34.9) port 80 (#0)
> POST /posting_success.php HTTP/1.1
> User-Agent: Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)
> Host: www.olx.com.mx
> Accept: */*
> Cookie: formHash=bae5113a467eebcb37b5b89d1aacc7e0
> Content-Length: 244
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 244 out of 244 bytes
< HTTP/1.1 302 Moved Temporarily
* Server Apache/2.2.22 (Ubuntu) is not blacklisted
< Server: Apache/2.2.22 (Ubuntu)
< Location: posting.php
< Vary: Accept-Encoding
< Content-Encoding: gzip
< P3P: policyref="http://www.olx.com/w3c/p3p.xml";, CP="NON DSP COR CURa"
< Content-Length: 33
< Content-Type: text/html; charset=utf-8
< Date: Wed, 12 Nov 2014 08:43:15 GMT
< Connection: keep-alive
<
* Connection #0 to host www.olx.com.mx left intact

Por lo mismo me imagino que CONECTION #0 se refiere a que no fue publicado.

Alguna idea?.

Gracias


Reply to: