1
I’m trying to take jobs in google jobs and extract data to guadar in database or json.
Websites: GOOGLE JOBS SCREEN Notice how I have on the left a list with several jobs and when I click on some it displays on the screen next to more detailed information, as I do for each job on the left list to be clicked and then extract the text from the job title, as there in the image where it is written IT stage on the display side
My code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
url1 = 'https://www.google.com/search?client=firefox-b-d&ei=Ja39X_nUIKif5OUPp6eUkAE&q=vagas+estagio+ti&oq=vagas+estagio+ti&gs_lcp=CgZwc3ktYWIQAzIICAAQsQMQgwEyAggAMgIIADICCAAyAggAMgIIADICCAAyAggAMgIIADICCAA6BAgAEEc6CggAELEDEIMBEEM6BAgAEEM6DggAELEDEIMBEMcBEK8BOgsIABCxAxDHARCjAjoFCAAQsQM6BQguELEDOggIABDHARCvAVDeMFipTmClUGgCcAN4AIABnQKIAbUckgEGMC4xLjE1mAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=psy-ab&uact=5&ibp=htl;jobs&sa=X&ved=2ahUKEwjZlb7fyJbuAhXWGbkGHdiZAEUQutcGKAB6BAgDEAQ#htivrt=jobs&fpstate=tldetail&htilrad=-1.0&htidocid=jN52cIGLUm9ZT0BQAAAAAA%3D%3D'
# Definindo Drive
driver = webdriver.Chrome(executable_path=r'./chromedriver')
driver.get(url1) # Entrando no url1
# Click
time.sleep(10)
driver.quit() # Fechando o driver
How can I do?
But it has several elements with the same class, as I click on them°
– AndréL
In that case you can use
find_elements_by_class_name
, to return a list. See more about here: https://selenium-python.readthedocs.io/locating-elements.html– Vitor Daniel
So my problem was that returns a kkkk list, thank you
– AndréL