Home  >  Q&A  >  body text

Error when using PHP to crawl web content

Code:

$content = file_get_contents("http://www.zoology.csdb.cn/csdb/getInfo.asp?_=1491810154308&id=B684780B-92C7-40D8-8CE1-16064082031C");

Error report:
( ! ) Warning: file_get_contents(http://www.zoology.csdb.cn/cs... failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

But the website:
http://www.zoology.csdb.cn/cs...
There is no problem in accessing it with a browser.

淡淡烟草味淡淡烟草味2713 days ago614

reply all(6)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 13:18:44

    When I access the website, I get an error, Internal Server Error
    Do I need to log in? Then bring cookies and use curl

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:18:44

    The browser access for this link is still 500. The website is OK. You need to confirm whether the link is correct or whether the website requires logging in to obtain it

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:18:44

    Dear, I tested it myself, there is also a problem when accessing it through a browser

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:18:44

    Browser access error: Internal Server Error

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:18:44

    Browser opening is 500

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:18:44

    Browser opened: Internal Server Error, time: 2017-4-11 9:21

    reply
    0
  • Cancelreply