Need help with PostPage

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Dash
Posts: 4
Joined: 2005-11-26 17:44:53

Need help with PostPage

Post 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
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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')
Dash
Posts: 4
Joined: 2005-11-26 17:44:53

Post 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.
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
Post Reply