domxpath

    0熱度

    1回答

    從下面的XML我想提取Mobile_Number值,它是在values/value標記下。我怎樣才能使這個通用,因爲我們可以稍後有多個選項,而不是單個Mobile_Number選項。 <?xml version="1.0" encoding="UTF-8"?> <Request> <header> <businessTransactionID>ABCD</businessTr

    -1熱度

    1回答

    我有以下HTML: <html> <head> <meta http-equiv="refresh" content="0;URL=http://amazingjokes.com" /> </head> </html> 我想找到與重定向的META,所以我寫了下面的XPath查詢: /html/head/meta[@http-equiv="refresh"]

    1熱度

    1回答

    我有一個功能來抓取圖像src屬性在section標籤。但它給我圖片這個指定的部分標記(選擇class)。 $doc = new DOMDocument(); @$doc->loadHTMLFile('http://www.akairan.com/health/bimari-behdasht/news201691911413397586.html'); $finder = new DomXPa

    0熱度

    1回答

    我想通過使用DOMXPath對象及其evaluate()函數來輸入XPath的evaluate()。但是,我收到了一些意想不到的結果。在這個例子中,兩個XPath結構或多或少都是相同的,除了在無效的結構中比較@begin。不過,我不明白爲什麼這段代碼是無效的。 <?php $newDomObj = new DOMDocument; $newXpathObj = new DOMXPath($n

    0熱度

    1回答

    我讀了很多的stackoverflow問題,我使用這段代碼,但我不知道爲什麼這是行不通的。 這是一個代碼。 $url = 'http://m.cricbuzz.com/cricket-schedule'; $source = file_get_contents($url); $doc = new DOMDocument; @$doc->loadHTML($source); $xpath

    1熱度

    2回答

    我試圖去字串值的內容,其中比較有VALUE = item.auxiliaryData.productRef.brandName 我試着使用下面的代碼, XPathExpression expr = xpath.compile ("//comparator[contains(VALUE,'item.auxiliaryData.productRef.ancestorCategoryId

    0熱度

    1回答

    我的頭很疼。 我最近做了一個網站,並使用DOMXpath。它與URL完美結合。 現在我想從同一個文件夾中的html文件中獲取東西。突然之間,最簡單的事情成爲最多的問題。 我甚至不知道爲什麼它不能使用文件而不使用URL。 以下是文件: error_reporting(0); include_once "db_config.php"; $file = $DOCUMENT_ROOT. "today.

    0熱度

    1回答

    到目前爲止,我得到完整的頁面html現在我想從該頁面獲取描述列表的數據。我是新的網絡報廢,所以請幫助我與此? 這裏是我想要的html。 <dl id="specs"> <dt class="section">Keyboard</dt> <dt>Keyboard</dt> <dd>88 keys</dd> <dt>Touch Sensitivity</dt>

    0熱度

    1回答

    使用此功能meta標籤: function get_tags($adres) { $dom = new domDocument(); libxml_use_internal_errors(true); if (!$dom->loadHTML($adres)) { echo "Error"; } else echo "Load ok";

    0熱度

    1回答

    我上html文件進行解析結構如下: <div class="lstImv blackBd12"> <div class="stCl3 stLeft imvImg"> <div class="imgBox"> <a class="emp-imgs-link"> <span class="imgFrm frmBig frmLeft">