Python script to control Chrome browser via selenium

Job ID: 38688807

Budget: $10 – $30 USD

Write a Python script to do the following tasks:
Before running the Python code, we opened Chrome and logged in to the ChatGPT account, so please do not let the script open the Chrome browser again.

For the xlsx file Test-EN.xlsx:
For rows 2 to LR (LR is the row number of the last non-empty cell in column A)
If the cell in column B is not empty and the cell in column C is empty, then:

Point 1:
Open the ChatGPT link(https://chatgpt.com/?model=gpt-4o-mini as an example) in Chrome
Wait for 5-8 seconds, if the status is not 200(404 for example), then stop the script, else enter the text in column B as a prompt, and ask ChatGPT

If it shows that we have reached the ChatGPT usage limit, then stop the script, else:
Wait 20-30(random) seconds to check if the reply is completed.
If not completed, wait 20-30(random) seconds again to check if the reply is completed.

If it shows that we should click the <Continue generating> (see the attachment continue_generating.jpg) during the waiting, then click it.

If completed, check if the reply text contains contentReference or not, if it contains, then go to Point 1 and run the code again.

At the end, copy the URL from the web browser to column C of the xlsx file and save the xlsx file

Technic conditions
1. Python version: 3.11.9
2. Chrome version: the latest

Requirements:
1. Only one tab can be opened in Chrome
2. We have no ChatGPT account to give you for testing, so you need to test the script with your ChatGPT account
3. The Code of the script must not be encrypted
Related categories: Python CSS HTML Selenium Webdriver Selenium