Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First entry in search results is not a search result #5

Open
andy71 opened this issue Aug 10, 2018 · 0 comments
Open

First entry in search results is not a search result #5

andy71 opened this issue Aug 10, 2018 · 0 comments

Comments

@andy71
Copy link

andy71 commented Aug 10, 2018

Hi there,

every time when I tried to search for a movie, the first entry was completely different from my search. Just as an example, today I searched with crit => "Electric Dreams" (movie from 1984) and the first result was "Die Ritter der Kokosnuß" (engl. "Monty Python and the Holy Grail" from 1975).
screenshot - 10 08 2018 - 15 02 24

After taking a look on the search result I found this "result" within the navigation menu as a recommendation.
screenshot - 10 08 2018 - 14 42 02

I am wondering that no one else seems to have this issue?

After studying the codes of IMDB-Film and digging into the source code of the IMDb results page, I found a solution which seems to work for me. All real results where inside a DIV with the class "findSection". So I added this part of code within BaseClass.pm inside the sub "_search_results" behind this line
my $parser = $self->_parser();

	while (my $token = $parser->get_token) {
		if ($token->[0] eq 'S' and $token->[1] eq 'div') {
			if (exists $token->[2]{class} and $token->[2]{class} eq 'findSection') {
				$self->_show_message("Jumped to DIV " . $token->[2]{class}, 'DEBUG');
				last;
			}
		}
	}

This little snippet just moves forward within $parser until it founds a div with class 'findSection'. After this your code works like a charm (as far as I checked this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant