English > Scripts and Templates
HOW can I get the clicked URL of the SearchResults list
meriator:
The script I currently trying to do
includes URLS
with POST and GET methods
and the site does not accept
POST instead of GET and vice versa
(http://www.filmportal.de)
I should be able to get the URL of the searchresults list
that was choosen/clicked before the download starts
to parse it and return the correct method.
I tryed everything without success,
no way to get this URL before GetDownloadMethod is executed
the earlist state to get the URL is after download
but this of cource fails either with ...
HTTP/1.1 400 Bad Request
(GET instead of POST)
or
HTTP/1.1 405 Method Not Allowed
(POST instead of GET)
Is there a way ?
thanks
cu meriator
meriator:
by the way Happy Christ.... ;)
to all here
cu meriator
mgpw4me:
The following link has a script that MAY help you...
http://www.videodb.info/forum_en/index.php/topic,1665.20.html
If you follow the smPage global variable, you'll see how I implemented multiple pages within the search results. In your case,
function ParsePage(HTML : String; URL : AnsiString): Cardinal;
var
RVal : Integer;
begin
if ((Pos('/mediaindex',URL) > 0)) then begin; // this is a valid IMDB image location
if ((Pos('&ipage=load',URL) > 0) and (Mode <> smPage)) then begin; // user selected a page, not an image
PageUrl := URL; // set the url to retrieve another search page
Result := prDownLoad; // download the page
Mode := smPage; // parse search results
// SET POST METHOD HERE
end
else
// SET GET METHOD
If you have trouble, post the script and I'll take a look at it.
meriator:
thanks mgpw4me for trying
but this does not realy solve the problem
as I allready explained above
the script parses the searchresults
at this point I allready know which of the URLs need which METHOD to be set
but I cant set a METHOD here in fact of,
I do not know at this time which of the result items will be choosen/clicked
and I cant apply an invidual METHOD to each item of the searchlist at this point
so after an item has got choosen/clicked
the function GetDownloadMethod get called
but now I cant get the URL that was clicked to parse it
and to return the right METHOD
try it your self
(http://www.filmportal.de) search for "Fluch"
you will get a long list of result but only 10 per page
so the script has to add Buttons as searchresults
atleast
one for go to next page (if curPage < lastPage)
and
one for go to previous page (if curPage > 1)
the results them self need the GET METHOD
the NAV buttons need the POST METHOD
but how can I know what will be clicked
hope this is more understandable now
cu meriator
mgpw4me:
Understood. My explanation was not complete enough (or won't work). I don't see the problem, so I'll have to try it myself.
Now that I have a sample title to work with, I'll see what I can do with it over the next day or two.
I've been wanting to play with "post" anyway...aveleyman.com has content I want, but it requires "post" and I've been too lazy to investigate the process.
Navigation
[0] Message Index
[#] Next page
Go to full version