簡體   English   中英

PHP:SimpleHTMLDom - 幫我獲取 html 頁面代碼?

[英]PHP: SimpleHTMLDom - Help me get the html page code?

誰能幫我實現從這個頁面https://investmint.ru獲取 html 代碼? 我正在使用“SimpleHTMLDom”庫,但出了點問題,我得到一個空響應。 盡管其他站點使用此代碼也能正常工作。 怎么了? 誰可以建議或給予建議?

include("simplehtmldom/simple_html_dom.php");

$url = "https://investmint.ru";
$html = new simple_html_dom();
$html->load_file($url);
echo $html;

我會很高興做出任何決定,謝謝。

我得到一個空的響應......雖然其他網站可以正常使用此代碼

我懶得設置圖書館,所以我跑了這個……

print file_get_contents('https://investmint.ru');

我懂了....

<html><head><script>function set_cookie(){var now = new Date();
var time = now.getTime();time += 19360000 * 1000;now.setTime(time);
document.cookie='beget=begetok'+'; expires='+now.toGMTString()+';
path=/';}set_cookie();location.reload();;</script></head><body></body></html>

我懷疑你也有同樣的情況,但沒有正確調查。

用餅干試試。 並了解如何在瀏覽器中使用 web 開發人員工具。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM