提问者:小点点

“module”对象不可调用(请求库)


searchinput = "love"

print('Searching...')

google_search = requests.get('https://www.google.com/search?q='+searchinput)
print(google_search)

soup = BeautifulSoup(google_search.text , 'html.parser')
    
search_results = soup.select('div#main > div > div > div > a')

我试图获得谷歌搜索引擎的链接,但BeautifulSoup一直给错误“'module'对象是不可调用的”。 首先,这是因为错误429,我解决了它,但现在我不能进步了。 我该怎么修好呢?


共1个答案

匿名用户

看起来你是在直接调用某个模块。 请确保您的导入符合以下内容,并且具有库的最新版本。

from bs4 import BeautifulSoup
import requests