Код: Выделить всё
import os, sys
from bs4 import BeautifulSoup
path = os.path.abspath(os.path.dirname(sys.argv[0]))
fnHTML = os.path.join(path, "inp.html")
page = open(fnHTML)
soup = BeautifulSoup (page.read(), 'lxml')
worker = soup.find("span")
wHeadLine = worker.text.strip()
wPara = worker.find_next("td").text.strip()
print(wHeadLine)
print(wPara)
Код: Выделить всё
Find your faves—faster
We’ve made it easier than ever to see what’s on now and continue watching your recordings, favorite teams and more.
[img]https: //i.sstatic.net/TMcn4gSJ.png[/img]
Почему в тексте не выводятся символы «—» и «Мы»?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -using-bs4