Intento scrapar las preguntas y respuestas de google forms que se encontran en un archivo [csv][1]. Desafortunadamente parece que repaso los cuestionarios sin obtener las preguntas y respuestas. En efecto, con mi codigo : from collections import defaultdict from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import ElementClickInterceptedException import time from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import NoSuchElementException import pandas as pd from selenium.common.exceptions import ElementNotInteractableException, NoSuchElementException from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait import pickle def setup_chromedriver(): chrome_options = Options() # chrome_options.add_argument("--headless") # driver = webdriver.Chrome(ChromeDriverManager().install()) driver = webdriver.Chrome("C:\Programs\chromedriver.exe") return driver def load_data(): df = pd.read_csv("research_assistant_intern_recruitment.csv") filter_col = ["Link"] return df, filter_col def extract(driver, df, survey): # locations = df[column].iteritems() count = 0 result = [] for location, task in zip(df.Link, df.Task): print("location: ", location) print("task: ", task) if task == survey: questionaire = {} if "docs.google.com" in str(location): location = location driver.get(location) # I get all the card with questions and answers inside containers = driver.find_elements_by_class_name( "freebirdFormeditorViewItemcardRoot.item-dlg-affectsIndex.item-dlg-dragTarget" ) # for each card for container in containers: try: # Get the question question = container.find_element_by_class_name( "appsMaterialWizTextinputTextareaInput.exportTextarea" ) except NoSuchElementException: print("NoSuchElementException: ") continue # Get the answers responses = container.find_elements_by_class_name( "quantumWizTextinputSimpleinputInput.exportInput" ) extracted_responses = [response.get_attribute("data-initial-value") for response in responses] questionaire[question.text] = extracted_responses btns_next = driver.find_elements_by_class_name('appsMaterialWizButtonPaperbuttonContent.exportButtonContent') if btns_next: print("btns_next: ", btns_next) btns_next[0].click() driver.set_page_load_timeout(30) driver.set_script_timeout(30) result.append({count: questionaire}) count += 1 return result if __name__ == '__main__': """ Need to log on to the google account to access certain questionaires. Also Setup chromedriver to run in headless state """ driver = setup_chromedriver() """ Load CSV download of Google Sheet """ df, columns = load_data() surveys = ['Hotel ABC', "Airline XYZ", "The Ministry of Tourism of France"] for survey in surveys: result = extract(driver, df, survey) survey = survey.replace(" ", "_") pickle_out = open("applicant" + survey + "_c.p", "wb") pickle.dump(result, pickle_out) pickle_out.close() Estoy recibiendo las preguntas y respuestas del primer cuestionario. Sin embargo, cuando itero sobre cuestionarios, hay ciertos sobre cuales tengo que pulsar el botón `next`. **¿Cómo presiono el botón "siguiente"?** Hasta how, cada vez que termino una pagina, se abre una nueva pestaña. Lo que es horripilante. [1]: https://drive.google.com/file/d/1tUM0oHq9Pg8vmTKysbj5aryOHSNDah7I/view?usp=sharing