Skip to content

Instantly share code, notes, and snippets.

@Wanhenri
Created July 8, 2022 18:27
Show Gist options
  • Save Wanhenri/dbc6000fc7b44d0cce57549b918c36da to your computer and use it in GitHub Desktop.
Save Wanhenri/dbc6000fc7b44d0cce57549b918c36da to your computer and use it in GitHub Desktop.
Solucao para coleta das informações
arrayName = [
'"Custo Variável Unitário - CVU"'
]
for nomeProcesso in arrayName:
sentence = nomeProcesso.replace(' ', '')
split_string = sentence.split("-", 1)
substring = split_string[1]
#Add
driver.find_element_by_tag_name("input").send_keys(nomeProcesso)
driver.find_element_by_tag_name("input").send_keys(Keys.ENTER)
time.sleep(5)
#Add -> Pegando diretamente da tag <div>
ttt4 = driver.find_element(By.XPATH, "//div[@class='row']/div[@id='_br_com_seatecnologia_in_buscadou_BuscaDouPortlet_hierarchy_content']")
print(ttt4.text)
#Ou podemos utilizar a versão onde pegamos do script js
time.sleep(10)
#Add -> Pegando diretamente da tag <script>
script_label = driver.find_element_by_xpath("//script[@id='_br_com_seatecnologia_in_buscadou_BuscaDouPortlet_params' and @type = 'application/json']")
jsonText = script_label.get_attribute('innerHTML')
print(jsonText)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment