starts a web session and returns a web session object.
StartWebSession["browser"]
starts a web session using the specified browser.
StartWebSession
starts a web session and returns a web session object.
StartWebSession["browser"]
starts a web session using the specified browser.
Details and Options
- StartWebSession creates a WebSessionObject that represents a web browser being controlled by WebExecute.
- By default, StartWebSession will bring up a visible web browser window on the screen. Commands in the web session will then be executed visibly in this window.
- StartWebSession supports the following option:
-
Visible True whether the web browser window is visible - Possible choices of "browser" include:
-
"Chrome" Google Chrome web browser "Firefox" Mozilla Firefox web browser - StartWebSession updates $CurrentWebSession to the WebSessionObject it creates.
- DeleteObject[WebSessionObject[…]] ends a session started by StartWebSession.
Examples
open all close allBasic Examples (2)
Start a web session with a "Chrome" browser:
session = StartWebSession["Chrome"]Open a webpage, then capture it as an Image:
WebExecute[session, {"OpenPage" -> "https://wolfram.com", "CapturePage"}]End the session with DeleteObject:
DeleteObject[session]session = StartWebSession["Chrome"]Sessions are persistent across calls to WebExecute:
WebExecute[session, "OpenPage" -> "https://www.wolframalpha.com"]WebExecute[session, "PageTitle"]End the session with DeleteObject:
DeleteObject[session]Scope (2)
Multiple web sessions can be run simultaneously:
Map[StartWebSession, {"Firefox", "Chrome"}]DeleteObject[%]Multiple web sessions run in their own independent process:
sessions = Table[StartWebSession["Firefox"], 2]Map[#["Process"]&, sessions]DeleteObject[sessions]Options (1)
Visible (1)
Start a new session in "headless mode", where the browser is not visible:
session = StartWebSession["Chrome", Visible -> False]WebExecute[session, "OpenPage" -> "https://www.wolfram.com"]WebExecute[session, "PageTitle"]Close the session and exit the invisible browser:
DeleteObject[session]Related Guides
Related Workflows
- Control a Web Browser Programmatically ▪
- Extract Textual Content from Webpages
History
Text
Wolfram Research (2019), StartWebSession, Wolfram Language function, https://reference.wolfram.com/language/ref/StartWebSession.html.
CMS
Wolfram Language. 2019. "StartWebSession." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StartWebSession.html.
APA
Wolfram Language. (2019). StartWebSession. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StartWebSession.html
BibTeX
@misc{reference.wolfram_2026_startwebsession, author="Wolfram Research", title="{StartWebSession}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/StartWebSession.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_startwebsession, organization={Wolfram Research}, title={StartWebSession}, year={2019}, url={https://reference.wolfram.com/language/ref/StartWebSession.html}, note=[Accessed: 13-June-2026]}