Was bedeutet Backtrace: Ordinal0 [0x00723AB3+2505395] im Stack-Trace-Fehler bei der Verwendung von Selenium und ChromeDrPython

Python-Programme
Anonymous
 Was bedeutet Backtrace: Ordinal0 [0x00723AB3+2505395] im Stack-Trace-Fehler bei der Verwendung von Selenium und ChromeDr

Post by Anonymous »

Ich bin relativ neu im Codieren und mit Stacktrace-Fehlern noch nicht so vertraut.
Mir wurde dieser Fehler angezeigt, ich bin mir aber nicht sicher, welchen Teil meines Codes ich reparieren soll? Ist der Fehler aufgrund einer NoSuchElementException aufgetreten oder lag es an einem Timeout-Fehler?
Ich dachte, dass ich in meinem Code damit umgegangen bin, wie das Programm mit der Nosuchelement-Ausnahme umgehen wird. Grundsätzlich sucht mein Code nach verfügbaren Slots und deaktiviert die Zurück-Schaltfläche, wenn ein Slot verfügbar wird. Es treten jedoch auch andere Arten von Fehlern auf, z. B. ein Verbindungs-Timeout, wenn die Webseite zu lange inaktiv war. Daher besteht meine Aufgabe nun darin, die verschiedenen Probleme, mit denen ich konfrontiert bin, herauszufiltern, damit ich mich mit den jeweiligen Problemen befassen kann. Ich habe die erwarteten Bedingungen als Filter hinzugefügt, um die Fehler zu unterscheiden, mit denen ich konfrontiert werde
Code:

Code: Select all

no_slot = True
while no_slot == 1:
for i in range(60):
search_button = browser.find_element(By.NAME, "btnSearch")
search_button.click()
try:
noslot_back_button = browser.find_element(By.CSS_SELECTOR, 'input[name="btnBack"]')
except NoSuchElementException:
if EC.presence_of_element_located(browser.find_element(By.XPATH, '//td[@class="title"]')):
# Proceed with booking (make sure that it is at the booking page (implementation)
slot_radio_info = browser.find_element(By.NAME, 'slot')
slot_id = slot_radio_info.get_attribute('id')
radio_button = browser.find_element(By.XPATH, '//input[@id="' + str(slot_id) + '"]')
radio_button.click()
slot_submit_button = browser.find_element(By.CSS_SELECTOR, 'input[value="Submit"]')
WebDriverWait(EC.element_to_be_clickable(slot_submit_button))
slot_submit_button.click()
double_cfm_button = browser.find_element(By.CSS_SELECTOR, 'input[value="Confirm"]')
double_cfm_button.click()
elif not EC.title_contains('BBDC: Booking For TP Driving Simulator Lesson'):
print("Connection timed out or something else happened")
else:
print("unaccounted condition")
Fehler erhalten:

Code: Select all

Traceback (most recent call last):
File "C:/Users/Jonathan/PycharmProjects/Riddle/BBDC.py", line 83, in 
noslot_back_button = browser.find_element(By.CSS_SELECTOR, 'input[name="btnBack"]')
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1238, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 418, in execute
self.error_handler.check_response(response)
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"input[name="btnBack"]"}
(Session info:  chrome=95.0.4638.69)
Stacktrace:
Backtrace:
Ordinal0 [0x00723AB3+2505395]
Ordinal0 [0x006BAE41+2076225]
Ordinal0 [0x005C2498+1057944]
Ordinal0 [0x005ECB74+1231732]
Ordinal0 [0x00616D92+1404306]
Ordinal0 [0x00605A2A+1333802]
Ordinal0 [0x00615168+1397096]
Ordinal0 [0x006058BB+1333435]
Ordinal0 [0x005E23E4+1188836]
Ordinal0 [0x005E323F+1192511]
GetHandleVerifier [0x008ACB36+1554566]
GetHandleVerifier [0x00954A0C+2242396]
GetHandleVerifier [0x007B0E0B+523099]
GetHandleVerifier [0x007AFEB0+519168]
Ordinal0 [0x006C02FD+2097917]
Ordinal0 [0x006C4388+2114440]
Ordinal0 [0x006C44C2+2114754]
Ordinal0 [0x006CE041+2154561]
BaseThreadInitThunk [0x7739FA29+25]
RtlGetAppContainerNamedObjectPath [0x77987A9E+286]
RtlGetAppContainerNamedObjectPath [0x77987A6E+238]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Jonathan\PyCharm\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals)  # execute the script
File "C:\Users\Jonathan\PyCharm\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Jonathan/PycharmProjects/Riddle/BBDC.py", line 86, in 
if EC.presence_of_element_located(browser.find_element(By.XPATH, '//td[@class="title"]')):
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1238, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 418, in execute
self.error_handler.check_response(response)
File "C:\Users\Jonathan\venvs\automation\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//td[@class="title"]"}
(Session info: chrome=95.0.4638.69)
Stacktrace:
Backtrace:
Ordinal0 [0x00723AB3+2505395]
Ordinal0 [0x006BAE41+2076225]
Ordinal0 [0x005C2498+1057944]
Ordinal0 [0x005ECB74+1231732]
Ordinal0 [0x00616D92+1404306]
Ordinal0 [0x00605A2A+1333802]
Ordinal0 [0x00615168+1397096]
Ordinal0 [0x006058BB+1333435]
Ordinal0 [0x005E23E4+1188836]
Ordinal0 [0x005E323F+1192511]
GetHandleVerifier [0x008ACB36+1554566]
GetHandleVerifier [0x00954A0C+2242396]
GetHandleVerifier [0x007B0E0B+523099]
GetHandleVerifier [0x007AFEB0+519168]
Ordinal0 [0x006C02FD+2097917]
Ordinal0 [0x006C4388+2114440]
Ordinal0 [0x006C44C2+2114754]
Ordinal0 [0x006CE041+2154561]
BaseThreadInitThunk [0x7739FA29+25]
RtlGetAppContainerNamedObjectPath [0x77987A9E+286]
RtlGetAppContainerNamedObjectPath [0x77987A6E+238]

python-BaseException
Traceback (most recent call last):
File "C:\Users\Jonathan\PyCharm\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 292, in _on_run
r = self.sock.recv(1024)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Process finished with exit code 1

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post