So If you hover over a valid gmail address within google sheet cells, a card will pop up with contact information including the gmail image of that person. I wonder if there is a reliable way to extract this images over a list of gmail address on google sheet.
google sheet
For now I wrote a selenium script to simulate the interaction of a human, which would just open a google sheet and use mouse to hover over each gmail address and scrape the image and move to next row. However I find this method extremely slow and highly unreliable.
while num_move < num_reps:
ActionChains(driver).move_by_offset(0, 21).perform()
time.sleep(5)
imgResults = driver.find_elements(By.XPATH, '//*[@id="yDmH0d"]/c-wiz/div[2]/div/span/div[1]/div[1]/div[1]/div/img')
# imgResults = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, '//*[@id="yDmH0d"]/c-wiz/div[2]/div/span/div[1]/div[1]/div[1]/div/img')))
print(imgResults)
# time.sleep(2)
# img = imgResults[0].get_attribute('src')
img = imgResults[0].get_attribute('src')
urllib.request.urlretrieve(str(img), "/Users/xiteng/Desktop/pythonProject/sheet_scroll/{}.jpg".format(num_move))
num_move += 1```