-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenwebservice.py
More file actions
26 lines (22 loc) · 819 Bytes
/
openwebservice.py
File metadata and controls
26 lines (22 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from selenium import webdriver
import time
class Pesquisa:
options = webdriver.ChromeOptions()
options.add_argument('lang=pt-br')
print('Parte 1')
def __init__(self):
mensagem = "AuthenticGames"
self.driver = webdriver.Chrome(executable_path=r'./chromedriver.exe')
self.driver.get('https://youtube.com')
print('Parte 2')
time.sleep(2)
#<div class="sbib_b" id="sb_ifc50" dir="ltr">
pesq = self.driver.find_element("xpath",'//input[@placeholder="Pesquisar"]')
time.sleep(2)
pesq.click()
pesq.send_keys(mensagem)
time.sleep(2)
btn = self.driver.find_element("xpath",'//button[@aria-label="Pesquisar"]')
btn.click()
time.sleep(6)
openwebservice = Pesquisa()