my program navigates to a website and saves the page source, and is supposed to write the source to a text file but i am getting an error.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time
import codecs
import os
browser = webdriver.Chrome(r'\\homedirpva1a01\USERSNC$\603225\chromedriver\chromedriver.exe')
time.sleep(5)
browser.get('https://turo.com/us/en/car-rental/united-states/atlanta-ga/mercedes-benz/c-class/1319201?endDate=09%2F27%2F2022&endTime=10%3A00&searchId=Vfn6vpnK&startDate=09%2F24%2F2022&startTime=10%3A00')
time.sleep(10)
htmll = browser.page_source
completeName = os.path.join(r'\\homedirpva1a01\USERSNC$\603225\chromedriver\chromedriver.exe', turo.txt)
file_object = codecs.open(completeName, "w", "utf-8")
file_object.write(html)
Error:
Traceback (most recent call last):
File "Y:\SIU\Teams\Bento\Ryan\TURO\get page source with save.py", line 11, in <module>
completeName = os.path.join(r'\\homedirpva1a01\USERSNC$\603225\chromedriver\chromedriver.exe', turo.csv)
NameError: name 'turo' is not defined