Attributeerror: модуль 'copy' не имеет атрибута 'deepcopy' при импорте BS4
from bs4 import BeautifulSoup as BS import requests url = 'https://oscarmini.com/2018/05/techfest-2018.html' page = requests.get(url) soup = BS(page.text, 'lxml') mydivs = soup.find("div", {"class": "entry-content"}) soup.find('div', id="dpsp-content-top").decompose() print(mydivs.get_text()) input()
Ниже приведено сообщение об ошибке, которое я получаю.
Traceback (most recent call last): File "C:/Users/USERNaME/Desktop/My Programs/Random/Oscarmini- Scrapper.py", line 1, in <module> from bs4 import BeautifulSoup as BS File "C:\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bs4\__init__.py", line 35, in <module> import xml.etree.cElementTree as default_etree File ":\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\xml\etree\cElementTree.py", line 3, in <module> from xml.etree.ElementTree import * File "C:\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\xml\etree\ElementTree.py", line 1654, in <module> from _elementtree import * AttributeError: module 'copy' has no attribute 'deepcopy' Process finished with exit code 1
См. вопрос о переполнении стека
Что я уже пробовал:
<pre>from bs4 import BeautifulSoup as BS import requests url = 'https://oscarmini.com/2018/05/techfest-2018.html' page = requests.get(url) soup = BS(page.text, 'lxml') mydivs = soup.find("div", {"class": "entry-content"}) soup.find('div', id="dpsp-content-top").decompose() print(mydivs.get_text()) input()
Ниже приведено сообщение об ошибке, которое я получаю.
Traceback (most recent call last): File "C:/Users/USERNaME/Desktop/My Programs/Random/Oscarmini- Scrapper.py", line 1, in <module> from bs4 import BeautifulSoup as BS File "C:\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bs4\__init__.py", line 35, in <module> import xml.etree.cElementTree as default_etree File ":\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\xml\etree\cElementTree.py", line 3, in <module> from xml.etree.ElementTree import * File "C:\Users\USERNaME\AppData\Local\Programs\Python\Python36-32\lib\xml\etree\ElementTree.py", line 1654, in <module> from _elementtree import * AttributeError: module 'copy' has no attribute 'deepcopy' Process finished with exit code 1
См. вопрос о переполнении стека