Working on a project to automate searching a few thousand google searches and be able to check if there are "no results found" or not and input into an array.
Using BeautifulSoup but I can't get started by importing the HTML from a URL:
from bs4 import BeautifulSoup
import requests
html = requests.get('www.lifehack.org')
soup = BeautifulSoup(html,'html.parser')
the packages install fine but I get the error:
MissingSchema Traceback (most recent call last)
<ipython-input-28-8e881302fa25> in <module>
1 from bs4 import BeautifulSoup
2 import requests
----> 3 html = requests.get('www.lifehack.org')
4 soup = BeautifulSoup(html,'html.parser')
C:\Program Files (x86)\Anaconda\lib\site-packages\requests\api.py in get(url, params, **kwargs)
73
74 kwargs.setdefault('allow_redirects', True)
+Many more lines of similar stuff
I'm not sure how to fix this. I want to be able to quickly get the HTML straight into the program and not have to copy it and save in a local HTML file
Any help would be much appreciated, Thanks.