0
from urllib.request import urlopen
from bs4 import BeautifulSoup
import urllib
import random
from string import ascii_lowercase

def makesoup(url):
    thepage=urlopen(url)
    soupdata=BeautifulSoup(thepage, 'html.parser')
    return soupdata

soup=makesoup("https://www.google.com/search?q=dragon+ball+super+wallpaper&source=lnms&tbm=isch&sa=X&ved=0ahUKEwihzY6OvpfdAhVrJcAKHRi2D8cQ_AUICigB&biw=1366&bih=662")
print(soup.text)

I'm receiving an error on urlopen(). I really need some help.

1 Answers1

0

Google dosen't like to be requested via scripts or frames. if you want to search via google from another application you should try using the google search api.

https://developers.google.com/custom-search/json-api/v1/overview

Yes its limited to 100 requests a day but its the only legal option.

Phillip
  • 789
  • 4
  • 22