How to get google search page html code using python?

Viewed 14

I try to extract the google search page HTML code in python. I use requests module in python.

from bs4 import BeautifulSoup

url = "https://www.google.com/search?q=how+to+get+google+search+page+source+code+by+python"

resp = requests.get(url)
soup = BeautifulSoup(resp.text, 'html.parser')
print(soup)
search = soup.find_all('div',class_="yuRUbf")
print(search)

But I can't find any of this class_="yuRUbf" in the code. I think it do not give me the source code. Now how can I do this work.

I also used resp.content but it didn't work. I also selenium but it didn't work.

0 Answers
Related