Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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()


Below is the error message I get.

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


See Question on Stack Overflow

What I have tried:

<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()


Below is the error message I get.

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


See Question on Stack Overflow
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900