我試圖用YQL - http://www.empireonline.com/search/default.asp?search=Dragonheart(作爲例子)從帝國雜誌網站(電影評論(熱門匹配)表)得到結果,我使用螢火蟲獲取xpath,但它似乎並不想返回結果。這是我正在使用的;從網頁選擇表格數據
select * from html where url='http://www.empireonline.com/search/default.asp?search=cars' and xpath='/html/body/table[3]/tbody/tr[5]/td[2]/table[2]/tbody/tr/td/table[2]/tbody/tr/td/table[2]'
現在,它似乎能夠使用;
select * from html where url='http://www.empireonline.com/search/default.asp?search=cars' and xpath='//table'
但是,這一大堆的數據,我不需要認輸的。
這是一個常見問題**:瀏覽器添加強制性HTML元素到DOM **(如'head'和'tbody'),那些'tbody'不目前在源頭上。 – 2011-04-26 19:26:36
我得到的最好的是以下 - SELECT * FROM HTML WHERE url =「http://www.empireonline.com/search/default.asp?search=cars」and xpath =「// table [3] // table [2] // table [2] // table [2]「 – Garbit 2011-04-26 19:28:00
那麼你的問題解決了嗎?聽起來像你的評論中的XPath完全符合你的需求,對吧? – LarsH 2011-04-26 19:49:18