Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

Scraping oddly formatted numbers using Beautifulsoup

$
0
0

I'm trying to scrape an HTML table using BS4 Python, but for numbers formatted like this 247 759 384 (read as 247759384) in the HTML are appearing differently in python. I would like to output them as they are in the table.

temp = []
a = soup.findAll('tr')[1]
for td in a.find_all("td"):
    temp.append(str(td.text))
    #print(str(td.text))
a.findAll('td')[10].text

gives me an output of

'24\xa0081\xa0728'

instead of

24081728

Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>