Python Forum

Full Version: An Error in Requests Module
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am getting an error in requests module while I try to run the program...

THIS IS MY INPUT
import requests
from bs4 import BeautifulSoup
url = input(str("Enter the url: "))
r = requests.get(url)
AND THIS IS MY OUTPUT
Enter the url: "https://academy.exceedlms.com/uploads/resource_courses/targets/11170/original/index.html#/id/58c573bd1df2ca51c86ca067"
Traceback (most recent call last):
  File "C:/Users/dell/AppData/Local/Programs/Python/Python36-32/niitpythonprojectex.py", line 4, in <module>
    r = requests.get(url)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 612, in send
    adapter = self.get_adapter(url=request.url)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 703, in get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for '"https://academy.exceedlms.com/uploads/resource_courses/targets/11170/original/index.html#/id/58c573bd1df2ca51c86ca067"'
Please help me to solve the problem...
remove double quotes from your input:
Enter the url: https://academy.exceedlms.com/uploads/resource_courses/targets/11170/original/index.html#/id/58c573bd1df2ca51c86ca067
Also remove str from input() it's returning a string(str).
Have basic code for this in my tutorial here.
I got the problem solved
Thanks for the help friends....