I have a file full of Urls (about some 3000 urls) and the requirement is to get each url invoked in a browser tab and click on each page (just the click is enough on the loaded page), which redirects to a different page. This is all I need to do.
I have written a code for the urls to retrieve one by one and clink on the page (page is designed to click anywhere to land or redirect to a different page). However, while running the code an error is being thrown with "invalid argument". Any thoughts, how can I correct the error ?
Appreciate your support.
with open(dataFile, 'r') as urlFile:
urlFile.readline()
for url in urlFile:
driver = webdriver.Chrome('C:\\chromedriver_win32\\chromedriver.exe')
driver.get(url)
link = driver.find_element_by_xpath("/html/body")
link.click()
urlFile.close()
The above code should pull each url from the file on a new browser tab and click. Repeat the same until all the urls in the file are done.