0

This is my first time on webscraping , so dont get hard on me. I am learning to scrape the data out of site but I am getting the following error:

raise InvalidSchema("No connection adapters were found for '%s'" % url) InvalidSchema: No connection adapters were found for '('http://en.oxforddictionaries.com/definition/good', 'html.parser')'

This is my code:

import requests
from bs4 import BeautifulSoup


url=('http://en.oxforddictionaries.com/definition/good',"html.parser")
r=requests.get(url)
soup=BeautifulSoup(r.content)
links=soup.find_all("a")

I have seen other answers and notice i need to put http://, I have done that but to no avail.
Thank you for your time.

Community
  • 1
  • 1
White Shadow
  • 444
  • 2
  • 10
  • 26

1 Answers1

0

The 'html.parser' parameter should be passed to BeautifulSoup not requests.get. Passing it to the latter makes the url nonsensical to requests.get:

url = 'http://en.oxforddictionaries.com/definition/good'
...
soup = BeautifulSoup(r.content, 'html.parser')
Moses Koledoye
  • 77,341
  • 8
  • 133
  • 139