Searching¶
There are two methods and one class that contains the search results. One of the method search() is used for movies/drama information retrieval and the other search_people() is used for Casts/Artists who have their profiles on the website. It is same as searching for some term on the website.
search()¶
def search(name, page = 1, style = None, year=None, eps = None, score = None, match_all = True, max_results = 20)
This function is used to search the website for movies/dramas.
Parameters:¶
name(str) - This is the search term given for searching.
page(int) - This is the search page number for that specific search term that is being searched in. Similar to what you see on the website.
style(str) - This represents the country of origin.
This is always equal to the smaller text visible on the website after the title when searched for something. This is used to filter the results obtained.year(Union[int, str]) - This represents the year of release.
This is used to filter the results obtained.eps(int) - This represents the number of episodes that specified drama had.
This is used to filter the results obtained.score(str) - This represents the rating of the movie/drama.
This is used to filter the results obtained.match_all(bool) - To check if all the filters should match for the result.
Similar toORandANDoperation, but will be applied on filters.
AppliesANDoperation if true, else will applyOR.max_results(int) - The maximum number of results that can be returned by the search.
For filtering with score, you can use - or + to indicate lesser/grater than the current score. E.g. 7.1+ will match all results with score >=7.1
Returns:¶
The search results or None if no results are found.
Return type:¶
Union[SearchResult, None]
search_people()¶
def search_people(name, page = 1, max_results = 20, nationality = None)
This function is used to search the website for Casts/Artists.
Parameters:¶
name(str) - This is the search term given for searching.
page(int) - This is the search page number for that specific search term that is being searched in. Similar to what you see on the website.
max_results(int) - The maximum number of results that can be returned by the search.
nationality(str) - This represents the Person’s nationality.
This is always equal to the smaller text visible on the website after the title when searched for something. This is used to filter the results obtained.
Returns:¶
The search results or None is if no results are found.
Return type:¶
Union[PeopleSearchResult, None]
SearchResult¶
class SearchResult
This is the container for all the search results.
Supported Operations:¶
x[index] - Will return name present in names at the specified index if index is int or url if index is str. Raises TypeError otherwise.
len(x) - Will return the number of elements in the SearchResult.
str(x) - Will return the list of names in str format.
Attributes:¶
names(tuple) - It is tuple of all the movie/Drama names that were returned from search().
urls(dict) - It is a dict of all the urls that lead to the movie/drama website.
Keys are names and value is the url. Both are of type str.
Methods:¶
def get(self, x)
Returns the complete data for the specified search term.
Parameters:¶
x(Union[int, str]) - The index(int) of names or the name(str) itself for which the data will be scraped.
Returns:¶
The complete information of all the data that will be scraped from the webpage.
Return Type:¶
InfoPage
def get_all(self, limit)
Returns the complete data for all the search results present in the SearchResult.
Parameters:¶
limit(int) - Will limit the number of items to first n items.
Returns:¶
A list of InfoPage objects of data of each SearchResult item.
Return type:¶
list(InfoPage)
PeopleSearchResult¶
class PeopleSearchResult
This is the container for all the search results.
Supported Operations:¶
x[index] - Will return name present in names at the specified index if index is int or url if index is str. Raises TypeError otherwise.
len(x) - Will return the number of elements in the PeopleSearchResult.
str(x) - Will return the list of names in str format.
Attributes:¶
names(tuple) - It is tuple of all the movie/Drama names that were returned from search().
urls(dict) - It is a dict of all the urls that lead to the movie/drama website.
Keys are names and value is the url. Both are of type str.
Methods:¶
def get(self, x)
Returns the complete data for the specified search term.
Parameters:¶
x(Union[int, str]) - The index(int) of names or the name(str) itself for which the data will be scraped.
Returns:¶
The complete information of all the data that will be scraped from the webpage.
Return Type:¶
InfoPage
def get_all(self, limit)
Returns the complete data for all the search results present in the PeopleSearchResult.
Parameters:¶
limit(int) - Will limit the number of items to first n items.
Returns:¶
A list of InfoPage objects of data of each PeopleSearchResult item.
Return type:¶
list(InfoPage)