Cant scrape google search results with beautifulsoup
问题 I want to scrape google search results , but whenever i try to do so, the program returns an empty list from bs4 import BeautifulSoup import requests keyWord = input("Input Your KeyWord :") url = f'https://www.google.com/search?q={keyWord}' src = requests.get(url).text soup = BeautifulSoup(src, 'lxml') container = soup.findAll('div', class_='g') print(container) 回答1: To get correct result page from google, specify User-Agent http header. For only english results put hl=en parameter in URL: