iam_ironman
Power Member
- Oct 20, 2014
- 578
- 175
Python Code to Scrape Google Auto Suggest Keywords Using Python
Thanks
Code:
import requests
import json
query = "how to loose weight"
URL="http://suggestqueries.google.com/complete/search"
params = {"client":"opera",
"hl":'en', #Language
"q":query, #Query
"gl":'us'} #Country
response = requests.get(URL, params=params)
print(json.loads(response.content.decode('utf-8'))[1])
Thanks