TypeError: object of type 'HTTPConnection' has no len()

Hi,

I am trying to make a web scraping application with streamlit framework, but getting the below error while writing the below code, can anyone suggest how to resolve it.

url = st.text_input('www.example_abc.com')
connected = http.client.HTTPConnection(url)

TypeError: object of type 'HTTPConnection' has no len()
 page_soup = bs.BeautifulSoup(source, 'html.parser')
File "c:\programdata\anaconda3\lib\site-packages\bs4\__init__.py", line 245, in __init__
    elif len(markup) <= 256 and (

In python, we can work out with the below code:

import urllib.request as url
url.urlopen("https://www.abc.com/")

I required the type as “http.client.HTTPResponse”

Hi @goutamborthakur555 -

This appears to be the same issue as How to give an input option for url, so please continue the conversation there.

Best,
Randy