Page 1 of 1

Need help with PostPage

Posted: 2005-11-26 18:22:26
by Dash
Hi everybody,

first: I am pretty new to scripting, but learned a lot by looking at other scripts so far.

What I am currently trying to do, ist getting the search result page from here: http://www.invdeo.de/

After finding this line

Code: Select all

<form method=post action="http://www.invdeo.de/home.jsp?affid=1&smcmd=dvdlist_search">
on the page, I figure that I need to use the PostPage funtion.

I used this

Code: Select all

page := PostPage(searchpage, moviename);
with

Code: Select all

moviename := GetField(fieldOriginaltitle);
searchpage = 'http://www.invdeo.de/home.jsp?affid=1&smcmd=dvdlist_search';
in my Script, but somehow it ain't working. I don't know if I am missing a referer or something or doing something wrong, but if someone would be so kind and take a look at it, I would be really thankful.

Greets, Dash

Posted: 2005-11-26 19:00:55
by antp
The param values must bu URL-Encoded and you have to provide also the param name.
So the params must at least content
params := URLEncode('str=' + moviename)
And maybe also these hidden fields:
<input type=hidden name=orderby value=name>
<input type=hidden name=order value=1>
<input type=hidden name=category value=filme>
<input type=hidden name=typ value=sres>
so:
params := URLEncode('str=' + moviename + '&orderby=name&order=1&category=filme&typ=sres')

Posted: 2005-11-26 20:17:07
by Dash
[edit]
Just took a closer look at downloaded page. It works correctly. It seems, it's just a bug with the ShowMessage function.

Thanks again.
[/edit]






Thanks for the quick answer. It almost did the trick.

If I use

Code: Select all

C:\wget>wget "http://www.invdeo.de/home.jsp?affid=1&smcmd=dvdlist_search" --post-data=str="minority&orderby=name&order=1&category=filme&typ=sres"
it works all fine, but

Code: Select all

  moviename := GetField(fieldOriginaltitle);
  ShowMessage(moviename);
  params := URLEncode('str=' + moviename + '&orderby=name&order=1&category=filme&typ=sres');
  ShowMessage(params);
gives me

Code: Select all

str=movienameorderby=nameorder=1category=filmetyp=sres
It is missing all the "&". Then it should work fine.

Posted: 2005-11-26 21:04:04
by antp
Dash wrote: Just took a closer look at downloaded page. It works correctly. It seems, it's just a bug with the ShowMessage function.
Actually in Windows the & is used to indicate a keyboard shortcut, and so the letter that follows it is underlined. E.g. menu "File" is labelled "&File" actually.