imsdb_download_all_scripts icon indicating copy to clipboard operation
imsdb_download_all_scripts copied to clipboard

IndexError: list index out of range

Open jacobkreider opened this issue 6 years ago • 6 comments

Traceback after downloading 'O Brother Where Art Thous? Script.html':

Traceback (most recent call last): File "download_all_scripts.py", line 59, in title, script = get_script(relative_link) File "download_all_scripts.py", line 42, in get_script script_text = script_soup.find_all('td', {'class': "scrtext"})[0].get_text() IndexError: list index out of range

Not sure what's making it fail

jacobkreider avatar Dec 20 '18 00:12 jacobkreider

Maybe there on some inconsistent form in that movie content. I just skip that movie.

fatfishZhao avatar Sep 16 '19 22:09 fatfishZhao

Did anyone get around this error? I am having the same one @jacobkreider

nayanchavan avatar Jun 07 '20 18:06 nayanchavan

Well, I think the problem is in the ? character in the title, I am not sure how to solve this (I am a Python novice), but I found a way around it. I transformed the paragraphs 'href' into a list and then continued the iteration starting from the list member after this film [823] .. you can download the missing script manually

stats=[]
for p in paragraphs:stats.append(p.a['href'])
for p in stats[823:]:
        relative_link = p ##continue the code from here as given

Dnouvel avatar Jun 08 '20 12:06 Dnouvel

The same thing happens with: What About Bob? and Who Framed Roger Rabbit?

Dnouvel avatar Jun 08 '20 14:06 Dnouvel

I just used "try... except..." to skip the scripts with error. Only a very few scripts got skipped.

fatfishZhao avatar Jun 09 '20 01:06 fatfishZhao

Yeah, it has a problem with question marks since it is %3f in the URL. If you look at my fork, I manually skipped over the 3 movies that have a question mark in them and will download those three manually.

nayanchavan avatar Jun 09 '20 03:06 nayanchavan