第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從網(wǎng)站抓取的鏈接超鏈接獲取 HTML

從網(wǎng)站抓取的鏈接超鏈接獲取 HTML

PHP
素胚勾勒不出你 2022-11-04 17:10:00
我目前正在嘗試導航到另一個網(wǎng)頁,并使用我抓取的超鏈接獲取其 HTML。(我需要存儲在上面的信息)。我目前無法使用我生成的鏈接獲取 PHP curl 函數(shù)來獲取 HTML 代碼。我試圖用來構(gòu)建/獲取 HTML 代碼的代碼部分是:foreach($rows as $row){    //creating the link itself. https://pr.mo.gov/ is the website itself, the attribute that is returend is the direction location.    // /pharmacy-licensee-search-detail.asp?passkey=1285356, us an example of what I get from getArrtibute('href')    $holder = "https://pr.mo.gov/".$row->getAttribute('href');    // $holder = https://pr.mo.gov/pharmacy-licensee-search-detail.asp?passkey=1285356 as per the example used in the comments above.    echo $holder;    echo "<br>";    //trying to use curl to get the website html    $c = curl_init("$holder");    $html2 = curl_exec($c);    //Trying to print out what has been recived    echo var_dump($html2);     //IT's printing out bool(false)    curl_close($c);}這部分之前的代碼工作正?!驗樗鼜脑季W(wǎng)頁中獲取了 HTML。如果需要,我會發(fā)布它。
查看完整描述

1 回答

?
慕萊塢森

TA貢獻1810條經(jīng)驗 獲得超4個贊

您需要檢查curl_init調(diào)用的結(jié)果。

在它之后添加echo curl_error($c) . "<br>";以查看錯誤。很可能與 SSL 證書有關(guān)。如果是這樣,看看這個問題 - PHP - SSL certificate error: unable to get local issuer certificate

如果 curl_init 沒有錯誤,請curl_error在每次 curl 函數(shù)調(diào)用后使用,以獲取問題說明。


查看完整回答
反對 回復 2022-11-04
  • 1 回答
  • 0 關(guān)注
  • 136 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號