It's okay to crawl general pages ·. But recently I am confused about a website ·. Please help us to see what causes the failure. Thank you for choosing 183.36.249.82. The code I used is as follows {code...}, but this error will occur: ServerError... it is okay to crawl the general page ·.
But recently I am confused about a website ·. Please help us to see what causes the failure. Thank you.
Address: http: // 183.36.249.82/
Our school library.
The code I used is as follows:
However, this error occurs:
Server Error in '/'application.
Runtime Error
My server is SAE. I have also tried usingfetch
Function.
But it is a pity that an error is also reported.
Error: string (3) "500" string (21) "Internal Server Error"
The reason for the multiple-day study is unknown. Please answer. Thank you.
Reply content:
It's okay to crawl general pages ·.
But recently I am confused about a website ·. Please help us to see what causes the failure. Thank you.
Address: http: // 183.36.249.82/
Our school library.
The code I used is as follows:
However, this error occurs:
Server Error in '/'application.
Runtime Error
My server is SAE. I have also tried usingfetch
Function.
But it is a pity that an error is also reported.
Error: string (3) "500" string (21) "Internal Server Error"
The reason for the multiple-day study is unknown. Please answer. Thank you.
Usefile_get_contents
During crawling, you generally need to set HTTP context. It is better to capture webpages using cURL.
array( 'method' => 'GET', 'header' => $header, 'timeout' => 10, 'protocol_version' => '1.1', ),));$contents = file_get_contents('http://183.36.249.82/', false, $context); echo $contents;
Didn't you find the website requires redirection? I just learned php, right? Use curl instead. file_get_contents won't be able to catch this. (obviously, I am wrong. You can see what others have answered. It is terrible to have no culture ).
Let me give you a reference connection. I don't want to write code anymore.
Http://segmentfault.com/q/1010000000484804#a-1020000000484819
Although the person who asks the question is a ruby question, the php code is probably enough for your reference.