HTTP/1.1 505 HTTP Version Not Supported

前端 未结 2 1932
离开以前
离开以前 2021-02-20 17:37

I\'m running a PHP script to grab a web page. It worked fine with many sites, but with one site it fails, returning an error saying \"HTTP/1.1 505 HTTP Version Not Supported\".<

2条回答
  •  难免孤独
    2021-02-20 17:48

    I see you're using a space in your URL. That won't work To solve the problem I would put the url in another variable and encode it like so:

    $URL = urlencode("http://www.lovelybooks.de/stoebern/empfehlung/romantic fantasy/?seite=".$i);
    
    file_get_contents($URL);
    

提交回复
热议问题