AnsonLai / TeslaServiceManualScraper

This script will download the Tesla Service Manual onto a local doc folder for offline access.
MIT License
65 stars 12 forks source link

AttributeError: 'NoneType' object has no attribute 'endswith' #8

Closed yongsubchoi closed 2 years ago

yongsubchoi commented 2 years ago

images to be downloaded: 7740 visited: 952 upcoming: 3 images to be downloaded: 7752 visited: 953 upcoming: 2 images to be downloaded: 7753 visited: 954 upcoming: 1 images to be downloaded: 7754 visited: 955 upcoming: 0 images to be downloaded: 7759 ** SESSION SAVED ** Traceback (most recent call last): File "C:\TeslaServiceManual\ts1\scrape.py", line 270, in run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 263, in run driver.get_html() File "C:\TeslaServiceManual\ts1\scrape.py", line 152, in get_html self.restart_scrape() File "C:\TeslaServiceManual\ts1\scrape.py", line 43, in restart_scrape run() File "C:\TeslaServiceManual\ts1\scrape.py", line 265, in run clean_img_urls() File "C:\TeslaServiceManual\ts1\scrape.py", line 248, in clean_img_urls if url.endswith('jpg'): AttributeError: 'NoneType' object has no attribute 'endswith'

help me.....

decodering22 commented 2 years ago

Are you running the latest version? I've been using it with no issues what so ever. Make sure you have the latest version of the script.

AnsonLai commented 2 years ago

So what this is saying is that one of the images are not actually strings. I've run this a few times without running into this issue, but I pushed a new version that checks to ensure they are strings before appending it to the lists.