I'm developing a bot that will grab information about a specific movie from IMDb with the IMDbPY API. The error I think I'm having is with the 'get_movie()' method in the IMDb() class.
As seen in my code, I have no problem with grabbing the movieID based off string input containing the movie name.
As soon as I pass in the movieID to the get_movie() method, and print the contents to the screen, I get a massive error.
ia = imdb.IMDb()
fd = open('movielist.txt',"w")
print("Input your movie please: \n")
inp = input()
fd.write(inp)
fd.close()
def Main():
c = """Python Movie Rating Scraper by Nickydimebags"""
print(c)
time.sleep(2)
f1 = open('movielist.txt')
movie_list = []
for i in f1.readlines():
movie_list.append(i)
movie_list = ia.search_movie(i)
movie_id = movie_list[0].movieID
print(movie_id)
m = ia.get_movie(movie_id)
print(m)
Main()
I expect the output to contain information about the film, such as Title, Rating, Director, etc. It looks like the main error message is:
DOMHTMLMovieParser: caught exception extracting XPath "//b[text()='Series Crew']"
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/xml/etree/ElementPath.py", line 272, in iterfind
selector = _cache[cache_key]
KeyError: (".//b[text()='Series Crew']", None)
There are tons of other exceptions that show up that I'm not posting because of size constraints. But at the end of the errors I get this prompt:
Message: '%s: unable to gather refs: %s'
Arguments: ('DOMHTMLPlotParser',)
-I'm really not sure what any of this means. I've upgraded IMDbPY. If anyone has dealt with something familiar involving the IMDbPY, please let me know! Thanks