问题描述
如何解析Google搜索
import requests,webbrowser
from bs4 import BeautifulSoup
userResearch = input('Enter what to search:')
print('Searching...')
searcher = requests.get("https://www.google.com/search?q="+userResearch)
soup = BeautifulSoup(searcher.text,'html.parser')
search_result = soup.select('.r a')
for res in search_result:
print(res)
但是结果是它什么都不显示。如果没有for循环,它只会显示[]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)