, , , . - selenium, , Firefox chrome Phantom -, , , , .
google api, .
, : -
- Google Api, Google Api ( )
- Google Custom Search ,
- (google-api-python-client) python
( ! pip install google-api-python-client)
, , : -
from googleapiclient.discovery import build
my_api_key = "your API KEY TYPE HERE"
my_cse_id = "YOUR CUSTOM SEARCH ENGINE ID TYPE HERE"
def google_search(search_term, api_key, cse_id, **kwargs):
service = build("customsearch", "v1", developerKey=api_key)
res = service.cse().list(q=search_term, cx=cse_id, **kwargs).execute()
return res['items']
results= google_search("YOUR SEARCH QUERY HERE",my_api_key,my_cse_id,num=10)
for result in results:
print(result["link"])