新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
如何在python項目中使用PyQuery庫-創(chuàng)新互聯(lián)
本篇文章給大家分享的是有關(guān)如何在python項目中使用PyQuery庫,小編覺得挺實用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
安裝:
>>> pip3 install pyquery
引用方法:
from pyquery import PyQuery as pq
CSS選擇器:
from pyquery import PyQuery as pq html = '''''' doc=pq(html) print(doc("#container .list li"))
- first item
- second item
- third item
- fourth item
- fifth item
輸出結(jié)果:
以上就是如何在python項目中使用PyQuery庫,小編相信有部分知識點(diǎn)可能是我們?nèi)粘9ぷ鲿姷交蛴玫降?。希望你能通過這篇文章學(xué)到更多知識。更多詳情敬請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
當(dāng)前名稱:如何在python項目中使用PyQuery庫-創(chuàng)新互聯(lián)
文章出自:http://fisionsoft.com.cn/article/dphdch.html