Php 文件\u获取\u内容受限的问题

Php 文件\u获取\u内容受限的问题,php,Php,目前我的代码出现403禁止的错误 Warning: file_get_contents(https://website.com): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in simple_html_dom.php on line 75 Fatal error: Call to a member function find() on boolean in file.php on line 20 下

目前我的代码出现403禁止的错误

Warning: file_get_contents(https://website.com): failed to open stream: HTTP request failed! 
HTTP/1.1 403 Forbidden in simple_html_dom.php on line 75
Fatal error: Call to a member function find() on boolean in file.php on line 20
下面是我正在使用的代码(phpsimple\uhtml\udom.php部分就是simple\uhtml\udom库

$html = file_get_html("https://website.com");   
foreach($html->find('a') as $element) 
{
  // the foreach data here.
}
foreach
是发生错误的地方,之前相同的代码工作,然后随机停止。我假设发生了两种情况之一,Cloudflare阻止了我的网站IP,或者我达到了请求数量的配额


如何使用代理甚至Curl绕过此问题?

您可以询问网站运营商,他们是否有可以使用的api,而不是将他们的网站刮到足以被阻止的程度。@Sammitch我不完全同意您的措辞,但您没有错。@JohnDoe试图避开认为他们有权使用我的数据的刮取者,但不幸的是在我的职业生涯中,有太多的时间被亵渎了。奇怪的是,我竟然没有一句亵渎的话就把那句话抹掉了。