您的网址对我不起作用。但是有了
https://google.com/search?q=结果。
import urllibfrom bs4 import BeautifulSoupimport requestsimport webbrowsertext = 'hello world'text = urllib.parse.quote_plus(text)url = 'https://google.com/search?q=' + textresponse = requests.get(url)#with open('output.html', 'wb') as f:# f.write(response.content)#webbrowser.open('output.html')soup = BeautifulSoup(response.text, 'lxml')for g in soup.find_all(class_='g'): print(g.text) print('-----')阅读美丽汤文档



