无法以人类可读的格式处理某些数据

I've created a script in python using requests in combination with BeautifulSoup to fetch the tabular content from this webpage but when I run the script I get some unreadable stuff like the following.

截断部分:

SA÷1¬~ZA÷ENGLAND: Premier League¬ZEE÷dYlOSQOD¬ZB÷198¬ZY÷England¬ZC÷v1t6uXL7¬ZD÷t¬ZE÷zoZ4r7jR¬ZF÷0¬ZO÷0¬ZG÷1¬ZH÷198_dYlOSQOD¬ZJ÷2¬ZL÷/football/england/premier-league/¬ZX÷00England     007ngland0000000000001000Premier Leag014League000¬ZCC÷0¬ZAF÷England¬~AA÷UFOgEYGu¬AD÷1557669600¬ADE÷1557669600¬AB÷3¬CR÷3¬AC÷3¬CX÷Brighton¬ER÷Round

我尝试过:

import requests
from bs4 import BeautifulSoup

link = "https://www.flashscore.com/football/england/premier-league-2018-2019/results/"

r = requests.get(link)
soup = BeautifulSoup(r.text,"lxml")
results = soup.select_one("#tournament-page-data-results").get_text(strip=True)
print(results)

如何以人类可读的格式处理数据?

PS我不追求任何基于硒的解决方案。

评论
  • hquia
    hquia 回复

    请求和BeautifulSoup做工作

    如果您查看网页的来源,将会看到:

    <div id="tournament-page-data-results">SA÷1¬~ZA÷ENGLAND: Premier League¬ZEE÷dYlOSQOD¬ZB÷198¬ZY÷England¬ZC÷v1t6uXL7¬ZD÷t¬ZE÷zoZ4r7jR¬ZF÷0¬ZO÷0¬ZG÷1¬ZH÷198_dYlOSQOD¬ZJ÷2¬ZL÷/football/england/premier-league/¬ZX÷00England     007ngland0000000000001000Premier ...