python 變量轉(zhuǎn)義
href = a_url['href'].lower()?
title = a_url.get_text()?
href 和title 是抓取的鏈接和文本,但是會帶有特殊字符串,如何轉(zhuǎn)義了?
這里如何用re模塊來轉(zhuǎn)義了?
href = a_url['href'].lower()?
title = a_url.get_text()?
href 和title 是抓取的鏈接和文本,但是會帶有特殊字符串,如何轉(zhuǎn)義了?
這里如何用re模塊來轉(zhuǎn)義了?
2017-12-10
舉報
2017-12-20
帶有特殊字符串可能是編碼的問題,可以嘗試用decode('utf-8')轉(zhuǎn)碼。