-1
我試圖從trip advisor中檢索評論,而不是編寫代碼,因此我決定使用scrapy附帶的shell。當我測試這個Xpath時scrapy shell測試xpath無效的語法
response.xpath(//div[@id="REVIEWS"]/a/text())
我得到無效的語法錯誤。
我試圖從trip advisor中檢索評論,而不是編寫代碼,因此我決定使用scrapy附帶的shell。當我測試這個Xpath時scrapy shell測試xpath無效的語法
response.xpath(//div[@id="REVIEWS"]/a/text())
我得到無效的語法錯誤。
嘗試
response.xpath('//div[@id="REVIEWS"]/a/text()')
這適用於大部分地區,但該數組長度爲0,即使通過谷歌尋找Chrome的檢查元素好像不應該是0 – Smashed
什麼,我回答是關於你的'語法error' :) – itzMEonTV
好的謝謝你的答案 – Smashed