Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Create one Selenium WebDriver before the loop, then call driver.get(url) for each URL. Each call navigates the same current tab; process the page inside the loop before moving to the next URL, or the browser will simply end up showing the last page.
Use one WebDriver and navigate inside a loop
This is the basic pattern for visiting a list of pages in sequence in one browser tab:
from selenium import webdriver
urls = [
"https://example.com/first",
"https://example.com/second",
"https://example.com/third",
]
driver = webdriver.Chrome()
try:
for url in urls:
driver.get(url)
print("Page title:", driver.title)
# Read or interact with this page here, before the next navigation.
finally:
driver.quit()
The key is where the driver is created: once, before the loop. The official Selenium Python API defines get(url) as navigation to a URL in the current window or tab. The URL must include a protocol such as https:// or http://. Each navigation replaces the page shown in that tab; it does not create another one. See the Selenium Python WebDriver API.
Recommended Free Tools
Why only the last URL may appear
If the loop calls driver.get(url) several times without doing page work between calls, Selenium moves on after each navigation. By the time the loop finishes, the current tab displays the final URL. Put extraction, assertions, or other page-specific actions directly after each get() call.
#1 Best Overall
Creating webdriver.Chrome() inside the loop has the opposite problem: it starts a separate WebDriver/browser session for each iteration rather than reusing the same one. Keep driver creation outside the loop when the requirement is one session and one tab.
Wait for the page state your next action needs
driver.get() returns after the browser fires the page’s onload event, according to Selenium’s API reference. That is not a guarantee that every asynchronous request, client-side render, or application update has finished. If your next step depends on a particular element or state, wait for that condition explicitly.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
urls = [
"https://example.com/first",
"https://example.com/second",
]
driver = webdriver.Chrome()
try:
wait = WebDriverWait(driver, 10)
for url in urls:
driver.get(url)
heading = wait.until(
EC.visibility_of_element_located((By.TAG_NAME, "h1"))
)
print(url, "->", heading.text)
finally:
driver.quit()
Here, the loop waits for a visible h1 before reading its text and continuing. Choose a condition that represents readiness for your task: visibility, presence, clickability, a changed URL, or another observable state. The timeout is an example value, not a promise that every site will load within that period. Selenium’s documentation cautions that AJAX-heavy pages may require waits; see the Selenium Python API documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Collect results before the next navigation
Because each visit replaces the current document, save any values you need while the page is still open. For example, store a URL and title in a list rather than expecting the browser to retain earlier pages:
Rank #3
from selenium import webdriver
urls = [
"https://example.com/first",
"https://example.com/second",
"https://example.com/third",
]
results = []
driver = webdriver.Chrome()
try:
for url in urls:
driver.get(url)
results.append({
"url": url,
"title": driver.title,
})
finally:
driver.quit()
for result in results:
print(result)
Replace the title lookup with the page data or interaction your task actually needs. If one page can fail without stopping the whole batch, catch errors around that page’s navigation or processing and record the failure, while keeping driver.quit() in the outer finally block so cleanup still occurs.
Set up and close the browser reliably
The current Selenium getting-started example follows the same lifecycle: create a driver, navigate and interact, then call driver.quit(). The Python API landing page says modern Selenium uses Selenium Manager to handle browser and driver installation for most supported platforms and browsers. It does not cover every possible local setup, so if startup fails, consult the current Selenium setup documentation for your browser and operating system.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Use quit() once, after the sequence is complete. It closes the browser session and its windows. A finally block ensures the cleanup runs even if a URL or page operation raises an exception. Selenium’s first-script guide shows the navigation-and-cleanup pattern.
Same tab or multiple tabs?
Repeated driver.get(url) calls are the simplest choice when each page can be processed and then replaced. Use separate tabs only if pages need to remain open simultaneously or you need to switch among them.
Best Value
| Need | Approach | Trade-off |
|---|---|---|
| Visit and process pages sequentially | One driver; call driver.get() inside the loop |
One active tab; each new page replaces the previous one. |
| Keep pages open together | Open or switch tabs/windows and track window handles | Requires handling tab creation, switching, and closing. |
Selenium represents window and tab contexts with window handles. Its guide describes the new-window/tab feature as available in Selenium 4 and later; consult Selenium’s windows and tabs documentation if you need that workflow. It is unnecessary for the one-tab sequence described here.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common failures
- The browser ends on the last URL. This is expected if the loop navigates repeatedly without processing each page. Move page-specific work immediately after
driver.get(url). - Each iteration opens another browser. The driver is probably being created inside the loop. Create it once before the loop and reuse it.
- The URL is rejected or navigation does not work. Check that each string is a complete URL, including
https://orhttp://, as required by the WebDriver API. - An element lookup fails immediately after navigation. The page may have fired
onloadwhile the target element is still being rendered asynchronously. Wait for the relevant element or state instead of assuming navigation means the application is ready. - The browser or driver will not start. Check the current Selenium setup guidance for your browser and platform. Selenium Manager handles installation for most supported environments in modern Selenium, but not necessarily every configuration.
- The browser stays open after an error. Put driver creation before the
tryand calldriver.quit()infinally, as in the examples.
Or skip the browser setup
If you only need screenshots of URLs—not browser interactions or custom Selenium logic—ScreenshotNeo is a screenshot API that can return an image or PDF from a URL. It is not a substitute for using Selenium to inspect and interact with each page in a live browser. The one-request example below saves a screenshot; see the ScreenshotNeo API documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/first -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes X-Page-Verdict and X-Billed headers. It also has an MCP server for AI agents, and the free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Sign up free for ScreenshotNeo.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Frequently Asked Questions
Does Selenium remember the pages visited earlier in the loop?
No. The browser displays only the current document in that tab. Store any titles, text, or other values you need in Python variables or a collection while each page is open.
Can I use this pattern with Firefox instead of Chrome?
The navigation logic is the same WebDriver pattern, but browser startup and installation depend on the browser and local environment. Consult Selenium’s current setup guidance for the browser you plan to use.
Can I open a page, process it, and then return to the previous page in the same tab?
A normal sequence of get() calls replaces the current page, but browser history can be navigated when needed. If you need multiple pages available at once, use tabs or window handles instead.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →

