第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從表中提?。⊿crapy)

從表中提?。⊿crapy)

郎朗坤 2021-05-09 11:14:30
想在python2中使用scrapy進行表解析時尋求幫助,這是我的表: 鏈接到表 我需要獲取<td>標簽的值。嘗試使用下一個python代碼:rows = resp.xpath('//*[@id="Vorlage_Infobox_Unternehmen"]')if not rows:    rows = resp.xpath('.//*[@id="Vorlage_Infobox_Unternehmen"]//table')try:    if rows:        extract = lambda row, path: row.xpath(path).extract_first().strip()        if '<th>' in str(rows):            infobox = {extract(row, 'string(./th)'): extract(row, 'string(./td)') for row in rows}        elif '<tr>' in str(rows):            infobox = {extract(row, 'string(./td[1])'): extract(row, 'string(./td[2])') for row in rows}        elif '<table>' in str(rows):            infobox = {extract(row, 'string(./th)'): extract(row, 'string(./td)') for row in rows}        else:            infobox = {extract(row, 'string(./table/tbody/tr[1])'): extract(row, 'string(./td[1])') for row in rows}但是我做錯了事,無法得到我的魔杖。請幫助我理解我的錯誤。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 141 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號