21 lines
714 B
Python
21 lines
714 B
Python
from selenium.webdriver import Chrome
|
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
from selenium.webdriver.chrome.options import Options
|
|
import time
|
|
|
|
url = 'https://www.iseecars.com/cars-for-sale#Location=90011&Radius=50&Make=Tesla&Model=Model+3&_t=a&maxResults=20&sort=BestDeal&sortOrder=desc&lfc_t0=MTYzMTAwMjc0MzQ4MQ%3D%3D'
|
|
|
|
chrome_options = Options()
|
|
chrome_options.add_argument("--headless")
|
|
|
|
|
|
with Chrome(options = chrome_options) as driver:
|
|
wait = WebDriverWait(driver, 10)
|
|
driver.get(url)
|
|
|
|
time.sleep(10)
|
|
|
|
teslas = driver.find_element_by_css_selector('div#cars_v2-result-list article')
|
|
model = teslas.find_element_by_css_selector('h3')
|
|
|
|
print(model.text) |