Update internet.py

This commit is contained in:
Saifeddine ALOUI 2024-03-19 15:18:15 +01:00 committed by GitHub
parent 7488360ccc
commit dcbbea0ce0
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(","):
for button_to_press in buttons_to_press.split(",") if type(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())