index.html — лежит в папке со скриптом.
————-
Запускаю этот скрипт:
from bs4 import BeautifulSoup import re def main(): html = open('index.html').read() print(html) if __name__ == '__main__': main()
[code python]Traceback (most recent call last):
File "C:\Users\Александр\Desktop\6\main.py", line 2, in <module>
from bs4 import BeautifulSoup
File "C:\Python38-32\lib\site-packages\bs4\__init__.py", line 32, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "C:\Python38-32\lib\site-packages\bs4\builder\__init__.py", line 515, in <module>
from . import _lxml
File "C:\Python38-32\lib\site-packages\bs4\builder\_lxml.py", line 16, in <module>
from lxml import etree
File "src\lxml\etree.pyx", line 1, in init lxml.etree
ValueError: builtins.type size changed, may indicate binary incompatibility. Expected 440 from C header, got 432 from PyObject[/code]
C:\Python38-32\python.exe -m pip install beautifulsoup
Пробовал так:
C:\Python38-32\python.exe -m pip install –upgrade beautifulsoup4
Обновилось. Что мне сделать ?