Community Question

I have been able to get and save the attached file to my hard drive. I can read it but I can not figure out how to pull just the data I want. In this case it is a stock quote for VZ. I want to just pull out the symbol and stock price.

I would appreciate any examples of how to accomplish that.

Thank You
WBS00001
Commented November 2016
@DJSures
If it were a feature, it would be good if there were 2 parameters associated with the HTTPGet function. Right now the Scrub program can limit the data gathered from the web page in 2 ways. One is by supplying an integer specifying a start position from which to begin and another integer specifying how much to get starting at that point. If the amount to get is beyond the end of the web page text, it simply gets whatever text there is instead.

Alternatively, two strings can be specified. The Scrub program uses the first string as a search parameter to locate the start position that way, and the other to specify an end position to indicate where to end. Additionally, the search for the end position does not begin until after the point at which the start string was found in the page text (plus the length of the start string). However, if the start position string is not found, then the end string is ignored and the entire web page is returned instead. If the start string is found, but not the end string, then the web page text is gathered to the end of the web page. It also pops up error messages should either of those conditions occur. There is a way to suppress those error messages should the user desire not to have them appear.

The program allows for mixing the two methods as well. For example a string to find the start position and an integer to specify how much text to get from the point at which the start string was found.

So, basically, to do the same thing, the two parameters would have to be such that they can take either an integer or a string.
WBS00001
Commented November 2016
@dbeard
You can delete the project yourself by going to it in the cloud. A delete option should appear for you since you posted it.
DJ Sures
Commented November 2016
Thanks! I don't think the parameters are necessary after reading your description. The ez-script SubString will do the same thing

Code:



# Get 50 characters after the 10th character
$x = SubString(httpGet("http://www.google.ca";), 10, 50))



*Note: that wont' work for you currently until the next ez-builder is updated because of the quote issue with current ez-builder. But it works on mine :D

WBS00001
Commented November 2016
@DJSures
Since we are on the topic of fixing errors in the script, I would like to take this opportunity to reiterate the fact that the script will also crash if the strings from a web page contain Line Feed or Carriage Return characters and the entire web page is loaded at once using FileReadAll. Correcting this would be helpful to folks who would like to work with the entire text from a web page at once from a single variable, as opposed to, reading the file line by line.

EDIT: Removed the request for optional parameters in FileRealAll since the SubString function will do that as well.

Thanks, once again, for all your efforts.
DJ Sures
Commented November 2016
You bet! Line feed has also been resolved
Question
Avatardbeard
Asked on Thursday, September 3, 2015