對於頁:http://watchimport.eu/product_info.php?products_id=13497的getElementsByTagName返回長度爲0
我用getElementsByTagName
身體標記,但這樣做的長度返回0。
其實,我想檢查Product not found!
任何形式的幫助是非常讚賞。
對於頁:http://watchimport.eu/product_info.php?products_id=13497的getElementsByTagName返回長度爲0
我用getElementsByTagName
身體標記,但這樣做的長度返回0。
其實,我想檢查Product not found!
任何形式的幫助是非常讚賞。
您可以通過下面的代碼檢查該網頁的內容:
document.querySelector("table.infoBox:nth-child(1)").innerText
是這樣的PHP版本,因爲我正在使用:$ doc = new DOMDocument(); \t \t \t \t \t @ $ doc-> loadHTMLFile($ link); – Atul
好吧,你沒有提前。我建議你使用JavaScript,它會更容易,是最好的做法。 –
示例代碼,請 –
你試圖做:'document.getElementsByTagName(「身體」)'? – cezar
嗯,我認爲你的代碼有一些錯誤。因爲getElementsByTagName('body')沒有問題:http://i.imgur.com/c1tgkUg.jpg –