I have been creating some scripts using Macro Scheduler and Web Recorder to capture several web pages.
In most of my scripts I have been able to figure out how to save a off-line copy of a web page, use image recognition to capture a portion of the web page and use the Extract Tag function to capture the text on a webpage that had over 400 tags.
My problem occurred the other night when my script blew up when the web site I was using changed their format and suddenly the elements I was capturing no longer existed.
I did some poking around in the Web Recorder help and found that there are two additional functions that will make my coding much simpler. These are Extract Table and Extract Table By Name. I cannot, however, figure out any way to highlight tables in Web Recorder with a tool similar to the Tag Extractor. I have not been able to record these to functions in action and I have been unable get the functions to work in Macro Scheduler. The help files are also quite minimal on these to functions. There are no suitable examples in the forums on this site.
Can you post some examples of these functions in action? I see these functions holding the power to reduce my 46 page script that captured a table with 419 cells to a simple 4 or 5 lines of code.
Having some code that I can cut and paste and experiment with should enable me to get back on the road to productivity.
Thanks for the help and the great product.
Extract Table and Extract Table By Name Examples Needed
Moderators: Dorian (MJT support), JRL
Extract Table and Extract Table By Name Examples Needed
Troy Jorgens
Poulsbo, Washington
Poulsbo, Washington
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
There is an example in the WebRecorder help file.
Try this script. It goes to our version comparison page and extracts the table to a CSV file:
You can use the Tag Extraction Wizard to help you determine the index number of the table if you are not comfortable looking at the HTML source.
Look at the source of the HTML and find the table tag. See if it has an ID or NAME attribute. If so you can use ExtractTableByName. If not you need to rely on the index (i.e. the first table is 0, and so on).
Try this script. It goes to our version comparison page and extracts the table to a CSV file:
Code: Select all
IE_Create>0,IE[0]
IE_Navigate>%IE[0]%,www.mjtnet.com/version_matrix.htm,r
IE_Wait>%IE[0]%,r
Wait>delay
IE_Wait>%IE[0]%,r
Wait>delay
IE_ExtractTable>%IE[0]%,,0,%SCRIPT_DIR%\table.csv,1,r
Look at the source of the HTML and find the table tag. See if it has an ID or NAME attribute. If so you can use ExtractTableByName. If not you need to rely on the index (i.e. the first table is 0, and so on).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?