Jump to content
TzingTzongPing

Pass captcha with curl

Recommended Posts

Posted

Salutari, am nevoie daca ma poate ajuta cineva cu un cod PHP, vreau sa extrag cu, CURL rezultatele unui form de pe site-ul http://ems.com.cn/english.html (Shippment number pentru test: LZ310505783CN), problema este ca acest form are si captcha ems.com.cn/ems/rand si nu stiu cum pot trece de captcha.

 

Sau alta varianta daca pot folosi captcha generat si sa fac curl cu aceasi sesiune.

 

Request URL: http://ems.com.cn/ems/order/singleQuery_t
Request Method: POST
Status Code: 200 OK
Remote Address:
Referrer Policy: no-referrer-when-downgrade

POST /ems/order/singleQuery_t HTTP/1.1
Host: ems.com.cn
Connection: keep-alive
Content-Length: 38
Pragma: no-cache
Cache-Control: no-cache
Origin: http://ems.com.cn
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://ems.com.cn/index.html
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

mailNum=LZ310505783CN&checkCode=614806

 

Platesc daca este nevoie.

 

Multumesc.

Posted (edited)

Revin cu problema mea, totusi am nevoie sa trec de acest captcha pe site-ul respectiv, m-am gandit sa setez cookie generat de la captcha in curl si sa fac post cu el, dar tot imi da eroare codul nu este correct.

 

am asa:

 

 $url="http://www.11183.com.cn/ems/order/singleQuery_t";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: Hm_lpvt_da6f1445af3167cf70ef00845d0e716b=1526109956"));
curl_setopt($ch, CURLOPT_POSTFIELDS,
    "mailNum=LZ33183--603CN&checkCode=496661");

 

Unde: 

 

Hm_lpvt_da6f1445af3167cf70ef00845d0e716b=1526109956 ==== (checkCode) 496661

 

 

Edited by TzingTzongPing

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...