1. 程式人生 > >【Python】Linux和Windows中python的差異

【Python】Linux和Windows中python的差異

() 問題 選項 警告 gpo lin 私有屬性 調試 bsp

慢慢寫...

--------------------------------------------------------------------------------------------------------------------------------

scrapy中用xpath時,由於xpath(‘text()‘).extract會自動過濾為空的選項,通過調試平臺,找到了<Selector>._root屬性.利用<Selector>._root / <Selector>._root.text來獲取文本(若無文本會返回None)

在windows中,使用<Selector>.root可運行, 使用<Selector>._root會得到警告(私有屬性的問題)

<Selector>.root 在服務器上試運行,報錯。

改成<Selector>._root 可運行

--------------------------------------------------------------------------------------------------------------------------------

【Python】Linux和Windows中python的差異