#๐Ÿ”’ automation of my tasks

8 messages ยท Page 1 of 1 (latest)

plush salmon
#

Hello, i go try scan all tasks but the python/selenium no detect the task

frosty nicheBOT
#

@plush salmon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

plush salmon
#

html tasks

twin root
plush salmon
#
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains

import time


driver = webdriver.Chrome()

# URL do site
url = "https://cmspweb.ip.tv"
Senha = "??"
RA = "111546204"
Digito = "0"

driver.get(url)


time.sleep(2)


acesso_alunos = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.ID, "access-student"))
)
acesso_alunos.click()


time.sleep(2)


ra_input = WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.ID, "ra-student"))
)
if ra_input.is_displayed():
    ra_input.send_keys(RA)  


digit_student_input = WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.ID, "digit-student"))
)
if digit_student_input.is_displayed():
    digit_student_input.send_keys(Digito)


password_student_input = WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.ID, "password-student"))
)
if password_student_input.is_displayed():
    password_student_input.send_keys(Senha)  

    
    password_student_input.send_keys(Keys.ENTER)


    elemento_clicavel = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, "#lproom_r29ecd7584984044c0-l .fr"))
)


elemento_clicavel.click()

elemento_clicavel_2 = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.ID, "roomDetailTms"))
)


elemento_clicavel_2.click()

time.sleep(5)

x_coord = 521
y_coord = 301


action_chains = ActionChains(driver)


action_chains.move_by_offset(x_coord, y_coord).click().perform()

time.sleep(5)



atividades = driver.find_elements(By.CSS_SELECTOR, "tr.MuiTableRow-root.css-wygh5w")

if atividades:
    print("have tasks!")
    print(f"number of task: {len(atividades)}")
else:
    print("dont have task")

time.sleep(2)```
frosty nicheBOT
#

Hey @plush salmon!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
frosty nicheBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.