Open URL
Load a web address in the current tab or a new one, and wait for it to load.
Only in
WarpX Browser
This is how most workflows reach a page. It loads the address in the tab the run is working in, or in a new tab, and waits until the page has loaded before the next block runs. Blocks after it act on that page.
Settings
- Open url
The address to load. It can hold references such as
{{variables.productUrl}}or{{loopData.pages}}. An address without a scheme getshttps://added.Examplehttps://shop.example.com/products?page={{loopData.pages}}- Wait for navigation
When the block counts the page as ready. load waits for the whole page and its resources. domcontentloaded waits only until the HTML is read, which is sooner. networkidle0 and networkidle2 both wait until the page has made no network requests for 500 ms, so networkidle2 never moves on sooner than networkidle0.
Exampleload- Open new tab
Opens the address in a new tab of the profile's browser instead of the current one. The new tab becomes the one the run works in.
ExampleUnchecked- Set as active tab
On: the tab is brought to the front of its window, if something else covers it. A tab that is already visible is not raised again. Off: with Open new tab, the new tab opens and the page before it is brought back in front. The run works in the tab either way.
ExampleChecked- Use custom User-Agent
Replaces the browser's User-Agent for this tab with the one you type below. The block loads the page, sets the User-Agent, then reloads the page so it is loaded with yours. Later pages in the tab use it too.
ExampleUnchecked- User-Agentwhen Use custom User-Agent is ticked
The User-Agent string to use. The box has no label of its own; it sits under Use custom User-Agent.
ExampleMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36- Delay time (ms)
How long to wait after the block finishes, in milliseconds. Write a range such as
1000,3000to pick a random wait in it each run.Example1000,3000
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
Leaves by its single output once the page is ready. The block's result is the address it opened. If the address is empty or not a valid URL, the block fails with an error.
Example: Visit every results page of a shop
- Start
- Loop data
- Open URL
- Get text
- Loop breakpoint
- Add Loop data after Start. Give it the loop id
pagesand loop through the numbers 1 to 5. - Inside the loop, add Open URL and set Open url to
https://shop.example.com/products?page={{loopData.pages}}. - Leave Wait for navigation on load and set Delay time (ms) to
1000,3000so the visits are not evenly spaced. - Add Get text with the selector
.product-titleto collect the names on each page. - Close the loop with Loop breakpoint.
Good to know
- How long the block waits for a page is set by the workflow's Tab load timeout setting, 30000 ms by default. If the page is not ready by then, the block fails.
- A page that keeps making requests, such as one that polls or streams, may never count as idle. Use load or domcontentloaded for those.
- A custom User-Agent overrides the one the profile's fingerprint was built with. Sites can compare it with the rest of the fingerprint, so leave it off unless you need it.
- With a custom User-Agent the page loads twice: first with the profile's own User-Agent, then with yours. After the reload the block waits for the whole page to load, whatever Wait for navigation says.
- On some profiles' browsers a custom User-Agent cannot be set, and the block fails when it is ticked.
- After Open URL the run starts at the top of the new page. A frame chosen earlier with Switch frame is forgotten.
- The editor no longer offers Add tab to a group, because a browser under automation has no tab groups. An older workflow that has it ticked runs as if it were not.
See also
- New window — Open a web address in a new window of the profile's browser, and carry on in it.
- Switch tab — Move the run to another open tab, found by its address, its title or its position.
- Get tab URL — Read the address of the current tab, or of every tab that matches a pattern.
- Loop data — Run the blocks after it once for each row, number, list item or element.