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

New Tip: Search Functionality #3

Closed TheNexusAvenger closed 2 years ago

TheNexusAvenger commented 2 years ago

Under the Tips section, there is a mention of getting other files for the styling of the website. While trying out a local download of the Model Y service manual, I noticed there is another index.json file that can be downloaded to get searching. The main caveat is that the search functionality requires fetching that file over an HTTP request, which necessitates running the manual with an HTTP server. python -m http.server works just fine from what I can tell. Adding these 2 notes may be beneficial.

AnsonLai commented 2 years ago

Do you know where this index.json file is? I'm not seeing it in sources, and frankly the lack of a search feature does bother me big time hahah.

Thanks!

TheNexusAvenger commented 2 years ago

index.json is fetched the first time a search is performed and is appended to the base URL of the service manual. For the Model 3, which is at https://service.tesla.com/docs/Model3/ServiceManual/en-us/, the index.json file is at https://service.tesla.com/docs/Model3/ServiceManual/en-us/index.json.

AnsonLai commented 2 years ago

Awesome, just updated the scrape.py to fetch the index.json file as well. I'm having a bit of trouble with the http.server, so search is still broken for me. I'll test this out in a bit. Thanks for the tips!

AnsonLai commented 2 years ago

Everything working! Awesome stuff dude!