IMPORTANT Extracted CSV is filled with weird data!

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

IMPORTANT Extracted CSV is filled with weird data!

Post by rblack » Tue May 13, 2008 5:48 pm

hello,
I am using MS10 and webrecorder to get some statistic data from some portals, and i have the following code:

LibLoad>IEAuto.dll,hIE
let>where=c:\data\test.csv
DeleteFile>%where%
/* some functions getting to the proper page */
//and finally extracting
LibFunc>hIE,ExtractTag,r,%IE[0]%,,TABLE,3,1,TABLE3
//The MessageModal Command shows perfectly what i want to extract (20kb-360kb of html code)
MessageModal>%r_6%
//so i want it to be written to a file
WriteLn>%where%,e,%r_6%

And?
And what i get in the written file is only the first line of the extracted html.
If i setup the TABLE3_SIZE to a large amount, ie: 100k and the code is not so big (ie 20k) the saved file has 100kb, and consists of the data i want to extract, then about 20 clear lines, and then some random DATA like again the data i extracted, or some mixed arabic symbols (if you open any .exe file in notepad you will see what i mean)
Please solve this problem! This is important for me. Why the message modal displays properly and the next line writes the file with bugs? HELP!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue May 13, 2008 5:57 pm

The extracted text must have some control characters, or binary data in it. This is affecting how the data is written to the file. If you send us the link to the page you are extracting from we might have a better idea and may be able to offer some code to replace any control chars with blanks.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue May 13, 2008 6:32 pm

I've just realised - you're using ExtractTag not ExtractTable. ExtractTag extracts the text inside the tag. If you want to extract a table to CSV you need to use the ExtractTable command.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

Post by rblack » Tue May 13, 2008 7:04 pm

ok Marcus, i have send the html page to the same e-mail as in your MSN profile

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts