0

I'm having an issue with the read_html function from pandas. I'm Trying to read a datatable in a webpage that is made with <div> instead of <td> and <tr>. I'm trying to do it with pandas but it shows me the error html5lib not found, please install it, but i've already installed in my Conda enviroment. Do you know how can I rebuild the enviroment or something like that to check if anaconda updates and start reading this library? Also I Can't import it as I do with pandas for Example.

The error:

Se produjo una excepción: ImportError
html5lib not found, please install it
 File "C:\Inversiones\Test2.py", line 24, in <module>
 df = pd.read_html(html)
 ^^^^^^^^^^^^^^^^^^
ImportError: html5lib not found, please install it

I show you my code :

# Python program to scrape table from website
# import libraries selenium and time
from selenium import webdriver
from selenium.webdriver.edge.service import Service as EdgeService
from webdriver_manager.microsoft import EdgeChromiumDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.edge.options import Options
from time import sleep
import pandas as pd
URL = "https://open.bymadata.com.ar/#/negociable-obligations"
# Create webdriver object
# driver = webdriver.Chrome()
options = Options()
# selenium 4
driver = webdriver.Edge(service=EdgeService(
 EdgeChromiumDriverManager().install()), options=options)
df = pd.read_html(driver.page_source)
print(df[0])

also I can show you that I have html5lib installed in my conda enviroment:

# packages in environment at C:\Users\armartinof\.conda\envs\converter:
#
# Name Version Build Channel 
attrs 23.1.0 pypi_0 pypi 
auto-py-to-exe 2.41.0 pypi_0 pypi 
beautifulsoup4 4.12.2 pypi_0 pypi 
bottle 0.12.25 pypi_0 pypi 
bottle-websocket 0.2.9 pypi_0 pypi 
bs4 0.0.1 pypi_0 pypi 
bzip2 1.0.8 he774522_0 
ca-certificates 2023年08月22日 haa95532_0 
certifi 2023年7月22日 pypi_0 pypi 
cffi 1.16.0 pypi_0 pypi 
charset-normalizer 3.3.2 pypi_0 pypi 
contourpy 1.1.1 pypi_0 pypi 
cycler 0.12.1 pypi_0 pypi 
eel 0.16.0 pypi_0 pypi 
et-xmlfile 1.1.0 pypi_0 pypi 
fonttools 4.43.1 pypi_0 pypi 
future 0.18.3 pypi_0 pypi 
gevent 23.9.1 pypi_0 pypi 
gevent-websocket 0.10.1 pypi_0 pypi 
greenlet 3.0.1 pypi_0 pypi 
html5lib 1.1 pyhd3eb1b0_0 
idna 3.4 pypi_0 pypi
kiwisolver 1.4.5 pypi_0 pypi
libffi 3.4.4 hd77b12b_0
matplotlib 3.8.1 pypi_0 pypi
numpy 1.26.1 pypi_0 pypi
openpyxl 3.1.2 pypi_0 pypi
openssl 3.0.12 h2bbff1b_0
packaging 23.2 pypi_0 pypi
pandas 2.1.2 pypi_0 pypi
pillow 10.1.0 pypi_0 pypi
pip 23.3 py311haa95532_0
plotly 5.18.0 pypi_0 pypi
pycparser 2.21 pypi_0 pypi
pyparsing 3.1.1 pypi_0 pypi
python 3.11.5 he1021f5_0
python-dateutil 2.8.2 pypi_0 pypi
python-dotenv 1.0.0 pypi_0 pypi
pytz 2023.3.post1 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
scipy 1.11.3 pypi_0 pypi
setuptools 68.0.0 py311haa95532_0
six 1.16.0 pyhd3eb1b0_1
sniffio 1.3.0 pypi_0 pypi
sortedcontainers 2.4.0 pypi_0 pypi
soupsieve 2.5 pypi_0 pypi
sqlite 3.41.2 h2bbff1b_0
tenacity 8.2.3 pypi_0 pypi
tk 0.1.0 pypi_0 pypi
tzdata 2023.3 pypi_0 pypi
urllib3 2.0.7 pypi_0 pypi
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
webencodings 0.5.1 pypi_0 pypi
wheel 0.41.2 py311haa95532_0
whichcraft 0.6.1 pypi_0 pypi
xz 5.4.2 h8cc25b3_0
zlib 1.2.13 h8cc25b3_0
zope-event 5.0 pypi_0 pypi
zope-interface 6.1 pypi_0 pypi

Can you help me solve this issue?

asked Nov 3, 2023 at 17:39
2
  • 1
    I don't see anywhere in the code that you are actually trying to import html5lib. Please post the full error traceback message. Commented Nov 3, 2023 at 17:44
  • 2
    Trying to read a datatable in a webpage that is made with <div> instead of <td> and <tr> If it's not actually a <table> element, then I don't think read_html() is going to work at all... Commented Nov 3, 2023 at 17:48

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.