在重定向

时间:2015-05-11 16:48:01

标签: php parsing curl file-get-contents

我正在尝试从网页解析,但我无法在PHP中加载网页,因为此页面可能会重新加载三次。我用curl尝试了一切,但它显示了我的空结果。谢谢。

https://cestovnelistky.studentagency.sk/Booking/from/PRAHA/to/BRATISLAVA/tarif/REGULAR/departure/20150511/retdep/20150511/return/false/ropen/false/credit/false/class/2?22#search-results

1 个答案:

答案 0 :(得分:1)

这似乎有效:

curl "https://cestovnelistky.studentagency.sk/Booking/from/PRAHA/to/BRATISLAVA/tarif/REGULAR/departure/20150511/retdep/20150511/return/false/ropen/false/credit/false/class/2?0" -H "Accept-Encoding: gzip, deflate, sdch" -H "Accept-Language: en-US,en;q=0.8,fr;q=0.6" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: max-age=0" -H "Cookie: locale=sk; currency=EUR; JSESSIONID=07311B3DF5030445D6D5952D71CA6673; searchform-settings=""{\\""sp\\"":[{\\""f\\"":\\""PRAHA\\"",\\""t\\"":\\""BRATISLAVA\\""}],\\""r\\"":false}""; __utmt=1; __utma=178078135.1790203919.1431363151.1431363151.1431363151.1; __utmb=178078135.3.10.1431363151; __utmc=178078135; __utmz=178078135.1431363151.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=178078135.1790203919.1431363151.1431363151.1431363151.1; __utmb=178078135.3.10.1431363151; __utmc=178078135; __utmz=178078135.1431363151.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)" -H "Connection: keep-alive" --compressed