html5lib not Found Error with this library installed

71 views Asked by At

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?

0

There are 0 answers