重定向后获取页面内容
Get content of page after redirects
我正在尝试从网页进行解析,但我无法在 PHP 中加载网页,因为此页面可能会重新加载 3 次。我用 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
这似乎有效:
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
我正在尝试从网页进行解析,但我无法在 PHP 中加载网页,因为此页面可能会重新加载 3 次。我用 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
这似乎有效:
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