BeautifulSoup: Can't convert NavigableString to string

后端 未结 4 1245
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 06:51

I\'m starting to learn Python and I\'ve decided to code a simple scraper. One problem I\'m encountering is I cannot convert a NavigableString to a regular string.

U

4条回答
  •  既然无缘
    2021-01-18 07:43

    I came up to this question and got it solved best by the answer of Mark Ramson from How to remove this \xa0 from a string in python? with

    import unidecode
    word = unidecode.unidecode(tag.string)
    

提交回复
热议问题