I am trying to read eldorado web page using CURL:
$curl = curl_init(); $url = "https://eldorado.ua/smartfon-samsung-galaxy-a52-8256-gb-black-sm-a525-fzkisek-/p71321565/"; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_AUTOREFERER, false); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_HEADER, 1); curl_setopt( $curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16' //'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1' ); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $content = curl_exec($curl); var_dump(curl_error($curl)); curl_close($curl);
$content variable has the following contents:
HTTP/1.1 200 OK Content-Type: text/html Cache-Control: no-cache, no-store Connection: close Content-Length: 829 X-Iinfo: 13-324630841-0 0NNN RT(1638095614075 65) q(0 -1 -1 -1) r(0 -1) B12(4,316,0) U18 Strict-Transport-Security: max-age=15768000; includeSubDomains; preload Set-Cookie: visid_incap_1842303=FMRet2iZRrGNOuu82l7DO/5ao2EAAAAAQUIPAAAAAABVozZ0i7WNRFUDf/QdYAjO; expires=Sun, 27 Nov 2022 10:37:38 GMT; HttpOnly; path=/; Domain=.eldorado.ua; Secure; SameSite=None Set-Cookie: incap_ses_1339_1842303=OdttRK2/JxoEdGTA1xWVEv5ao2EAAAAAdzZ8EVHb34MWILP16s8cnA==; path=/; Domain=.eldorado.ua; Secure; SameSite=None <html style="height:100%"><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></head><body style="margin:0px;height:100%"><iframe id="main-iframe" src="/_Incapsula_Resource?SWUDNSAI=31&xinfo=13-324630841-0%200NNN%20RT%281638095614075%2065%29%20q%280%20-1%20-1%20-1%29%20r%280%20-1%29%20B12%284%2c316%2c0%29%20U18&incident_id=1339000480602535690-1335785097440988173&edet=12&cinfo=04000000&rpinfo=0&cts=pUCYtu4azOH0BoWedolrRwNhF%2fJP8SALxZ2aJzTHaLfVGw1YqkWG3zJRlnNPQgew&mth=GET" frameborder=0 width="100%" height="100%" marginheight="0px" marginwidth="0px">Request unsuccessful. Incapsula incident ID: 1339000480602535690-1335785097440988173</iframe></body></html>
Html body contains only iframe tag, which could not be properly displayed. Does anybody know how to get the whole html body contents?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.