---
title: "Downloading a Web Page & Using Literal Variables"
url: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/downloading-a-web-page-and-using-literal-variables.md"
canonical: "https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/downloading-a-web-page-and-using-literal-variables/"
tags: []
author: "Roy Osherove"
description: "Lesson 8 of 18 in Automating All the Things with FinalBuilder (Iterations and Variables), 3:00. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Downloading a Web Page & Using Literal Variables

1. [Courses](https://courses.osherove.com/#courses)
2. [Automating All the Things with FinalBuilder](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/)
3. Iterations and Variables

Lesson 8 of 18

Duration: 3:00 [Watch on YouTube](https://www.youtube.com/watch?v=uTNoztU25sM)

## In this lesson

Roy Osherove takes the input from the web with an HTTP get file action that accepts redirects and saves cnn.com to a file. The replacement then fails with could not expand replacement string, because [FinalBuilder](https://osherove.com/blog/2005/3/12/cooltool-finalbuilder-30-the-ultimate-build-management-and-a.html "[CoolTool] FinalBuilder 3.0 - the ultimate build management and automation tool (osherove.com)") tries to expand the percent signs in the downloaded HTML as variables, and an exclamation mark before the variable name tells it to read the value without parsing it.

## Transcript

413 words

[\[00:02\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=2s) Okay, let's make things a bit more interesting now instead of having those important files here in this folder. Let's let's get those important inputs directly from the web. So, let's try to download a file from the web. So, one way to do it is http get file. So, I'm just searching in the top for http. I got this. Let's try to download directly cnn.com.

[\[00:38\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=38s) And if I just leave this unchecked, cnna.com has a redirect going on when you just load it. So I'm going to say accept redirects and process the final HTML file that you get. And I'm going to save this to a file called important CNN.com.txt. And of course the location of the file will be full path generation slash the name of the file

[\[01:09\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=69s) And I override it just in case. So now what happens if I just try to do this and of course I want to move this up so it happens before I define the file set. So let's try to run this and see what happens. seems to download the file and then there is an interesting error could not expand replacement string. Now this error seems a bit strange but what we have to understand is that this is

[\[01:39\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=99s) A part that we have to we have to realize might happen every once in a while. Inside vall input there is an HTML string. How do I know? Well, we can of course debug. We can also take a look at the important of CNN.com which is right here. And inside we have a bunch of HTML that we've downloaded. If we look around, we'll look for percent sign. And there are plenty of percent signs over here for example.

[\[02:09\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=129s) And the problem is that when you tell FinalBuilder to replace stuff from this, it also looks and finds percent signs inside the value and then it tries to expand them as if they're input variables or anything. And there might be an unclosed percent sign somewhere because obviously it's HTML. It's not designed for FinalBuilder. So we can tell FinalBuilder to ignore and not try to expand the value inside here just by saying

[\[02:40\]](https://www.youtube.com/watch?v=uTNoztU25sM&t=160s) A exclam an exclamation mark before the name of the variable. So this means read the value in and don't try to parse the inside of the variable. So now if we try to do the same thing again, we'll see that now this works.

## Related

### Also linked in this lesson

#### osherove.com

- [\[CoolTool\] FinalBuilder 3.0 - the ultimate build management and automation tool](https://osherove.com/blog/2005/3/12/cooltool-finalbuilder-30-the-ultimate-build-management-and-a.html)

[Previous lesson Using the Debugger](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/using-the-debugger/) [Next lesson Making Variable Access Faster with Typing](https://courses.osherove.com/courses/automating-all-the-things-with-finalbuilder/making-variable-access-faster-with-typing/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
