TzingTzongPing Posted May 10, 2018 Report Posted May 10, 2018 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. Quote
iulik Posted May 10, 2018 Report Posted May 10, 2018 (edited) Te complici daca vrei sa spargi captcha + tre sa platesti un serviciu si sa lucrii cu el pe un numar limitat de captcha-uri ca sa treci la fiecare verificare, de ce nu incerci un API sau un site fara captcha? btw: https://docs.aftership.com/api/4/overview Edited May 10, 2018 by ManutaDeAur 1 Quote
TzingTzongPing Posted May 10, 2018 Author Report Posted May 10, 2018 Pfff, cu site-ul ala mai rezolvat, api nu imi este de folos deoarece pot face tracking doar la codurile introduse in baza lor de date, dar m-am folosit de asta https://track.aftership.com/ . Prin curl am extras exact ce trebuie. Mersi mult! Quote
TzingTzongPing Posted May 12, 2018 Author Report Posted May 12, 2018 (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 May 12, 2018 by TzingTzongPing Quote