I am trying to open a window, do some scraping and close it. I am trying to do this in a loop. This is the code:
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
import time
chromedriver = "F:\omkar\Download\chromedriver"
driver = webdriver.Chrome(chromedriver)
for i in range(0,3):
url="https://www.edureka.co/community/users?start=" + str(i*200)
driver.get(url)
time.sleep(3)
driver.close()
It opens the first window with no problem but the second window doesn’t open. I get this error
selenium.common.exceptions.WebDriverException: Message: invalid session id