Update internet.py

This commit is contained in:
Saifeddine ALOUI 2024-03-19 15:20:45 +01:00 committed by GitHub
parent dcbbea0ce0
commit 880e2ed1c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,7 @@ def press_buttons(driver, buttons_to_press=['accept']):
soup = BeautifulSoup(driver.page_source, 'html.parser')
# Find the button that contains the text "accept" (case-insensitive)
for button_to_press in buttons_to_press.split(",") if type(buttons_to_press)==str else buttons_to_press:
for button_to_press in buttons_to_press.split(",") if isinstance(buttons_to_press, str) else buttons_to_press:
try:
button_to_press = button_to_press.strip()
button = soup.find('button', text=lambda t: button_to_press in t.lower())