Script does not work
Closed this issue · 3 comments
kevinchua6 commented
first attempt to click date True
checking 14 th Feb for courts
Done searching
Traceback (most recent call last):
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\main.py", line 177, in <module>
main()
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\main.py", line 140, in main
csv.result()[1],
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\concurrent\futures\_base.py", line 428, in result
return self.__get_result()
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\concurrent\futures\_base.py", line 384, in __get_result
raise self._exception
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\main.py", line 45, in get_data_from_pa
available_timings = one_pa.get_available_timings(day)
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\one_pa.py", line 213, in get_available_timings
court_name, court_timing = self._get_timing_for_court_loc(driver)
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\one_pa.py", line 163, in _get_timing_for_court_loc
court_name = self._get_court_loc_name(driver)
File "C:\Users\x\Desktop\Badminton_Avalability_checker-master\one_pa.py", line 100, in _get_court_loc_name
.get_attribute("innerText")
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\site-packages\selenium\webdriver\remote\webelement.py", line 141, in get_attribute
self, name)
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\x\scoop\apps\anaconda3\2020.02\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
StaleElementReferenceException: stale element reference: element is not attached to the page document
(Session info: chrome=87.0.4280.88)
Even after clicking through the notice at the start, I still get this error and the csv file is not generated. I am attempting to fix this, but do you know what's the problem?
ElasticBottle commented
Hi, thanks for checking the script out!
I haven't been playing badminton ever since covid so unfortunately, didn't use // maintain it. Not too sure what's causing the error, I'm guessing they changed their webpage layout.
If you managed to fix it, feel free to open a pull request and I'll be more than happy to merge it in!
kevinchua6 commented
Hi, no problem, haha. I'll try my best to fix it, even though the onePA site keeps going down ><
ElasticBottle commented
Ya, I checked in this morning and just and it was down both times :')