iT邦幫忙

wrxue 的所有回答 82

爬蟲: 排除特定文字底下的所有標籤

應該就判斷結尾到了沒,到了就不要迴圈就好了吧 endText = '延伸閱讀》' for tag in soup.select('div.article p,...

2021-06-25 ‧ 由 聰明貓 提問

抱歉是初學者..有點sql的 select語法需要幫忙!!

根據文獻 Returns false on failure. For successful queries which produce a result se...

2021-06-17 ‧ 由 sky800219 提問

爬蟲: 如何在同一個標籤內將<br>區隔的內容,做換行處理

這樣的效果好像還不錯 for tag in soup.select('div#news-content p'): # 內...

2021-06-09 ‧ 由 聰明貓 提問

爬蟲: 如何在同一個標籤內對<br>之間含特定文字的內容做排除?

soup.select('dd.normal.first-thread div.user-comment-block')拿到的是整個文章了,所以你用 tag.g...

2021-06-09 ‧ 由 聰明貓 提問

#python 如何用遞迴函數 畫出等腰三角形

def tri(num): if num == 0: return tri(num - 1) print(' * ' *...

2021-06-05 ‧ 由 jeff5364628 提問

爬蟲: 使用排除標籤的語法,執行結果和預期不符

section#firstSingle div.post-content-container h2 strong:not(:last-of-type) 應該為...

2021-05-31 ‧ 由 聰明貓 提問

爬蟲: 如何去除含有特定文字的標籤

excepts = ['▲', '▼', '或其他想排除的文字'] for tag in soup.select('div.caas-body p'):...

2021-05-27 ‧ 由 聰明貓 提問

MVC 使用 Bootstrap 套版

我看你有三個Project,我猜你現在正在運行的應該是MVClogin 而不是你認為的MvcBootstrap當然就無法找到路徑(404)在solution上按...

2021-05-14 ‧ 由 新手上路 提問

爬蟲scrapy在指定的目標tag中,從第二個開始抓取內容

css 解法 res.select('div.story p:not(:first-of-type)') 如果 css 你不熟,那就用 if,這方法應該最基...

2021-05-07 ‧ 由 聰明貓 提問