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)
我在urlopen()
上收到一个错误。我真的需要帮助
谷歌不喜欢通过脚本或框架被请求。如果你想通过google从另一个应用程序中搜索,你应该尝试使用google搜索api
https://developers.google.com/custom-search/json-api/v1/overview
是的,一天最多100个请求,但这是唯一合法的选择
相关问题 更多 >
编程相关推荐