Grabbing HTML from text file to insert into websites Text

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Guest

Grabbing HTML from text file to insert into websites Text

Post by Guest » Fri Nov 25, 2005 7:11 pm

I have a text box on a html page that I need to grab information from a text file to insert it. The text file is around 5,000 lines long so I need to be able to just link to the text file. I can post all the content in the text file to a variable but I am not sure if that will screw things up.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Fri Nov 25, 2005 8:36 pm

IIM variables can contain up to 1 MB of text, so 5000 lines are no problem :D
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Fri Nov 25, 2005 8:41 pm

In the unlikely case that you need need to transfer more then 1 MB from your script to the macro, you can use two or more variables:

In the script this would look like this:
i = iim1.iimSet ("-var_text1", text_part1)
i = iim1.iimSet ("-var_text2", text_part2)
i = iim1.iimSet ("-var_text3", text_part3)

And in the macro:
TAG.... CONTENT={{text1}}{{text2}}{{text3}}
Guest

Post by Guest » Sun Nov 27, 2005 12:55 am

The text file is only 12 KB but I still have problems inserting it. Everytime I submit the content it always gets stuck at the same point. All that is posted is below

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title><$BlogPageTitle$></title>

  <$BlogMetaData$>

  <style type="text/css">
/*
-----------------------------------------------------
Blogger Template Style Sheet
Name:     Scribe
Designer: Todd Dominey
URL:      domineydesign.com / whatdoiknow.org
Date:     27 Feb 2004
------------------------------------------------------ */


/* Defaults
----------------------------------------------- */
body {
	margin:0;
	padding:0;
	font-family: Georgia, Times, Times New Roman, sans-serif;
	font-size: small;
	text-align:center;
	color:#29303B;
	line-height:1.3;
	background:#483521 url("http://www.blogblog.com/scribe/bg.gif") repeat;
}

blockquote {
	font-style:italic;
	padding:0 32px;
	line-height:1.6;
	margin:0 0 .6em 0;
}

p {margin:0;padding:0};

abbr, acronym {
	cursor:help;
	font-style:
and then here is the code that is right after it with repeating font-style...

Code: Select all

	font-style:normal;
}
	
code {font:12px monospace;white-space:normal;color:#666;}

hr {display:none;}

img {border:0;}

/* Link styles */
a:link {color:#473624;text-decoration:underline;}
a:visited {color:#716E6C;text-decoration:underline;}
a:hover {color:#956839;text-decoration:underline;}
a:active {color:#956839;}


/* Layout
----------------------------------------------- */
#wrap {
	background-color:#473624;
	border-left:1px solid #332A24;
	border-right:1px solid #332A24;
	width:700px;
	margin:0 auto;
	padding:8px;
	text-align:center;
}
This is more in the HTML that I submit to the variable but did not think you needed all of it. Can I point the macro to a text file for it to just use all the information in the text file for the template or is there another way that I can submit it instead of using...

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=NAME:frm1 ATTR=NAME:templateText CONTENT={{content}}
I am not encoding the content or anything to that is passed to the the script.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Mon Nov 28, 2005 5:17 pm

We are investigating this issue....
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Mon Nov 28, 2005 11:38 pm

For further testing, can you please email the 12KB text file to support2 AT iopus.com ? Maybe it contains a "bad" character that triggers this issue. To test this, we need the original file.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Wed Dec 07, 2005 3:12 pm

The issue is fixed. A solution is available with the next update (V5.02).
Last edited by Tech Support on Wed Dec 07, 2005 3:13 pm, edited 1 time in total.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Wed Dec 07, 2005 3:12 pm

Until V5.02 is released, a patch can be downloaded at http://forum.imacros.net/viewtopic.php?t=274
Post Reply