hi,
html code:
firm AreceiverUS$ 99,0
firm BrecorderUS$ 129,0
firm CtunerUS$ 79,0
how can you extract the price?
pattern extraction from html code
Moderators: JRL, Dorian (MJT support)
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
This code demonstates how to extract the price once you have identified a line with a price and put it into a variable. You can probably use ReadLn to get the line, and maybe looking for the $ sign can identify a line with a price but without seeing the file that's hard to say.
Let>myline=firm AreceiverUS$ 99,0
//find the $ sign
Position>$,%myline%,1,DollPos
//find the next DollPos,1
//set the length of the extract
Sub>LtPos,2
MidStr>%myline%,DollPos,LtPos,ThePrice
MessageModal>%ThePrice%
Let>myline=firm AreceiverUS$ 99,0
//find the $ sign
Position>$,%myline%,1,DollPos
//find the next DollPos,1
//set the length of the extract
Sub>LtPos,2
MidStr>%myline%,DollPos,LtPos,ThePrice
MessageModal>%ThePrice%
write the entire page
As you do not know the line, how can you write the whole code of the site into a variable? Then look for the positions.
the script should be like:
1. go to url
2. extract price reciever
the script should be like:
1. go to url
2. extract price reciever
Extracting data from HTML
I have done this, and the best method using Macro Scheduler is to use VBscript with RegEx (Regular Expressions) to match and extract patterns in data files. Regular expressions takes some study and lots of practice to get right, so don't expect it to be a quick fix.