1

I had a MacBook and I was running a code in Python. I never had any problems with its execution.

Last month, I bought a new MacBook "MacBook Air (M3)" and ran the same code.

On the new computer, I received the following error: net::ERR_HTTP2_PROTOCOL_ERROR.

Here is the code with the problem:

     servico = Service(ChromeDriverManager().install())
     options = webdriver.ChromeOptions()
     if headless:
        options.add_argument('--headless')
     #options.add_argument(f"user_agent={ua.random}")
     #options.add_argument("--disable-dev-shm-usage")
     options.add_experimental_option("detach", True)
     options.add_argument("--no-cache")
     navegador = webdriver.Chrome(service=servico, options=options)
     navegador.delete_all_cookies()
     navegador.get('https://azulpelomundo.voeazul.com.br/catalog/api/v1/availability?&tripType=ONE_WAY&origin=CGH&destination=CGB&adult=1&child=0&infant=0&typeOfFlight=ALL&companiesIdentity=-&cabinCategory=ECONOMY&departureDateTime=2025-05-20T00%3A00%3A00-03%3A00&page=1')
     return navegador

Does anyone know how to fix it?

I have tried all the ways and searched all the forums for a solution, but I have not found it.

I am using the latest version of Chrome; All the libs used are up to date.

1 Answer 1

0

The issue you are facing is not due to switching to MacBook. The URL you are trying to access gives the error.

You are accessing an API endpoint with Selenium, which is a very odd choice. The API request is tied with the front-end page load timing and cookies. So when it expires, the API endpoint doesn't response.

You should stick to the front-end automation with Selenium or try to get the URL with the correct cookie.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.