from googleapiclient.discovery import build
import pandas as pd
from bs4 import BeautifulSoup
import requests
import numpy as np

my_api_key = "AIzaSyC-djDYtVMjEJSubc8oaE-W-EEUrHJD0g0"
my_cse_id = "013234493367067861201:e_sqh9dvrhy"

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(
    'westbrook  ', my_api_key, my_cse_id, num=1)
print results[0]["formattedUrl"]
stats = pd.read_html("https://"+results[0]["formattedUrl"])
df = pd.DataFrame(stats[0])

for index, row in df.iterrows():
	if index == 0:
		rookie_stats = row

print rookie_stats
print (np.asarray(rookie_stats))[5:]

@@ -177,16 +177,17 @@
 rHJD0g0%22
+ 
 %0Amy_cse_
@@ -451,16 +451,136 @@
 tems'%5D%0A%0A
+PLAYERS = %5B%22Lebron James%22, %22Russell Westbrook%22, %22Stephen Curry%22, %22Paul George%22, %22Kevin Durant%22%5D%0Afor player in PLAYERS:%0A%09
 results 
@@ -599,26 +599,14 @@
 rch(
-%0A    'westbrook  '
+player
 , my
@@ -633,16 +633,17 @@
  num=1)%0A
+%09
 print re
@@ -667,16 +667,17 @@
 edUrl%22%5D%0A
+%09
 stats = 
@@ -728,16 +728,17 @@
 dUrl%22%5D)%0A
+%09
 df = pd.
@@ -758,16 +758,17 @@
 ts%5B0%5D)%0A%0A
+%09
 for inde
@@ -792,16 +792,17 @@
 rows():%0A
+%09
 %09if inde
@@ -809,16 +809,17 @@
 x == 0:%0A
+%09
 %09%09rookie
@@ -832,22 +832,69 @@
  = row%0A%0A
-print 
+%09rookie_stats = rookie_stats%5B:25%5D%0A%09print (np.asarray(
 rookie_s
@@ -901,15 +901,26 @@
 tats
-%0A
+))%5B5:%5D%0A%09
 print 
+len(
 (np.
@@ -925,29 +925,29 @@
 p.asarray(rookie_stats))%5B5:%5D
-%0A
+)

add for loop for particiapnts