Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Parse the html name of a website Automatically

Hey guys, I've been trying to do parsing html files automatically, but by now I still can't do it, because of the parsing of the websites.

I have an Inline table with names of websites, and I want to create a loop to parse these websites.

Here's my example code :

Sites :
load * inline [
PageName,
qlik.com
google.com
];

FOR i = 0 TO NoOfRows('Sites') - 1
LET vSite = '"http://www.'&peek('PageName', $(i))&'"';

Web:

LOAD

recno() as Position,
@1:n as Code
FROM $(vSite) (ansi, fix, no labels, record is line);

NEXT i

and I always have parsing errors of the web title while loading, like this :

error loading image

NOTE :

If I do manually the name of the web, assigning the variable like this :

FOR i = 0 TO NoOfRows('Sites') - 1

LET vSite = 'http://www.qlik.com';

Web:

LOAD

recno() as Position,
@1:n as Code
FROM $(vSite) (ansi, fix, no labels, record is line);

NEXT i

It works fine!!. But I want to do it automatically, and I'm trying to parse the dots, the single quotes, the double quotes, and I still don't get what's happening.

Any help would be appreciated.

Many thanks in advance!!

1 Solution

Accepted Solutions
Not applicable

Hi Marcel, I have experienced the same issue in the past, and I realized that if you add the name on the table within the peek function the error goes away, try this:

Sites :
load * inline [
PageName,
qlik.com
google.com
];

FOR i = 0 TO NoOfRows('Sites') - 1
LET vSite = 'http://www.' & peek('PageName', $(i),'Sites');

Web:

LOAD

recno() as Position,
@1:n as Code
FROM $(vSite) (ansi, fix, no labels, record is line);

NEXT i

Is you next step is parsing the html title label on the sites??, or was it only my imagination??

Regards

View solution in original post

4 Replies
Not applicable

Hi Marcel, I have experienced the same issue in the past, and I realized that if you add the name on the table within the peek function the error goes away, try this:

Sites :
load * inline [
PageName,
qlik.com
google.com
];

FOR i = 0 TO NoOfRows('Sites') - 1
LET vSite = 'http://www.' & peek('PageName', $(i),'Sites');

Web:

LOAD

recno() as Position,
@1:n as Code
FROM $(vSite) (ansi, fix, no labels, record is line);

NEXT i

Is you next step is parsing the html title label on the sites??, or was it only my imagination??

Regards

Not applicable

Hi Marcel,

i think that the problem is with using the peek function. Instead of it you may use FieldValue like this:

LET vSite = 'http://www.'&FieldValue('PageName', $(i));

(in the test file that i used it works)

Stefan

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Many thanks Ivan, It seems it's a little mistake of Qlikview, because If I'm not wrong, if you not specify the name of the Table, it gets the last table loaded.

Thanks, now it works fine!!

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks stefanstoichev,

I've tried your solution, and I don't know why, it didn't work. So I've tried Ivan's solution that works fine.

Thanks anyway and see you around!!